llvm-project/llvm/test/Transforms/IndVarSimplify
Nikita Popov dcf4b733ef [SCEVExpander] Make CanonicalMode handing in isSafeToExpand() more robust (PR50506)
isSafeToExpand() for addrecs depends on whether the SCEVExpander
will be used in CanonicalMode. At least one caller currently gets
this wrong, resulting in PR50506.

Fix this by a) making the CanonicalMode argument on the freestanding
functions required and b) adding member functions on SCEVExpander
that automatically take the SCEVExpander mode into account. We can
use the latter variant nearly everywhere, and thus make sure that
there is no chance of CanonicalMode mismatch.

Fixes https://github.com/llvm/llvm-project/issues/50506.

Differential Revision: https://reviews.llvm.org/D129630
2022-07-14 14:41:51 +02:00
..
AArch64 [IndVars] Add a new test affected by 62f86d4f 2022-03-17 13:49:07 -07:00
AMDGPU
ARM [SCEV] Use umin_seq for BECount of multi-exit loops 2022-05-21 15:48:14 +02:00
NVPTX
X86 [IndVars] Simplify instructions after replacing header phi with preheader value 2022-07-13 10:27:04 +02:00
2002-09-09-PointerIndVar.ll
2003-04-16-ExprAnalysis.ll
2003-09-23-NotAtTop.ll
2003-12-10-RemoveInstrCrash.ll
2003-12-15-Crash.ll
2004-03-10-PHIInsertionBug.ll
2004-04-05-InvokeCastCrash.ll
2004-04-07-ScalarEvolutionCrash.ll
2005-02-11-InvokeCrash.ll
2005-02-17-TruncateExprCrash.ll
2005-02-26-ExitValueCompute.ll
2005-06-15-InstMoveCrash.ll
2005-11-18-Crash.ll
2006-03-31-NegativeStride.ll
2006-06-16-Indvar-LCSSA-Crash.ll
2006-09-20-LFTR-Crash.ll
2006-12-10-BitCast.ll
2007-01-06-TripCount.ll
2007-06-06-DeleteDanglesPtr.ll
2007-11-23-BitcastCrash.ll
2008-06-15-SCEVExpanderBug.ll
2008-09-02-IVType.ll
2008-10-03-CouldNotCompute.ll
2008-11-25-APFloatAssert.ll
2009-04-22-IndvarCrash.ll
2009-04-27-Floating.ll
2009-05-24-useafterfree.ll
2011-09-10-widen-nsw.ll
2011-09-19-vectoriv.ll
2011-09-27-hoistsext.ll
2011-10-27-lftrnull.ll [SCEV] Add false->any implication 2021-03-19 11:29:48 +07:00
2011-11-01-lftrptr.ll [ScalarEvolution] Ensure backedge-taken counts are not pointers. 2021-06-21 16:24:16 -07:00
2011-11-17-selfphi.ll
2012-10-19-congruent-constant.ll
2014-06-21-congruent-constant.ll [IndVarSimplify] Replace legacy loop-unswitch with SimpleLoopUnswitch. 2022-04-23 14:08:47 +01:00
2020-12-15-trunc-bug-expensive-range-inference.ll [SCEV] Add missing type check into getRangeForAffineNoSelfWrappingAR 2020-12-15 14:50:32 +07:00
D108043.ll [IndVars] Drop check for the validity of rewrite 2021-08-30 12:06:58 +03:00
ada-loops.ll
addrec_no_exec_on_every_iteration.ll Return "[SCEV] Prove implicaitons via AddRec start" 2020-10-08 11:15:35 +07:00
ashr-expansion.ll [ValueTracking] Enable -branch-on-poison-as-ub by default 2022-06-01 10:46:06 +02:00
ashr-tripcount.ll
avoid-i0.ll
backedge-on-min-max.ll
bbi-63564.ll [SCEV] Track and invalidate ValuesAtScopes users 2021-11-30 18:21:14 +01:00
bec-cmp.ll
canonicalize-cmp.ll [Test] Auto-generated checks for some IndVarSimplify tests 2020-09-08 11:15:40 +07:00
casted-argument.ll
checks_against_min_value.ll [IndVars] Provide eliminateIVComparison with context 2021-03-19 12:28:22 +07:00
const_phi.ll
constant-fold.ll
constant_result.ll
crash.ll
cycled_phis.ll [Test] Add test showing that we can make a check loop-invariant 2022-07-13 18:01:58 +07:00
dangling-use.ll
deterministic-sign.ll [IndVarSimplify] Reduce nondeterministic behaviour in visitIVCast. 2021-11-16 12:41:04 +00:00
divide-pointer.ll
dont-recompute.ll
drop-exact.ll
elim-extend.ll [IndVars] Invalidate SCEV when IR is changed in rewriteLoopExitValue. 2021-10-20 20:48:33 +01:00
eliminate-backedge.ll [IndVars] Simplify instructions after replacing header phi with preheader value 2022-07-13 10:27:04 +02:00
eliminate-comparison.ll [IndVars] Call replaceLoopPHINodesWithPreheaderValues() for already constant exits 2022-07-13 09:43:21 +02:00
eliminate-exit-no-dl.ll [IndVars] Simplify instructions after replacing header phi with preheader value 2022-07-13 10:27:04 +02:00
eliminate-exit.ll [SCEV] By more careful when traversing phis in isImpliedViaMerge. 2021-05-07 19:52:29 +01:00
eliminate-max.ll
eliminate-overflow-modified.ll [IndVarSimplify] Fix Modified status for removal of overflow intrinsics 2020-09-29 13:20:59 +02:00
eliminate-rem.ll
eliminate-sat.ll
exit-count-select.ll [SCEVExpander] Expand umin_seq using freeze 2022-05-18 09:53:07 +02:00
exit_value_test2.ll Special case common branch patterns in breakLoopBackedge (try 2) 2021-08-27 10:27:16 -07:00
exit_value_test3.ll
exit_value_tests.ll [SimplifyCFG] MergeBlockIntoPredecessor() already knows how to preserve DomTree 2020-12-17 01:03:49 +03:00
finite-exit-comparisons.ll [SCEV] Use constant range of RHS to prove NUW on narrow IV in trip count logic 2021-11-05 15:36:47 -07:00
floating-point-iv.ll [IndVars] Simplify instructions after replacing header phi with preheader value 2022-07-13 10:27:04 +02:00
floating-point-small-iv.ll [IndVars] Eliminate redundant type cast between unsigned integer and float 2022-07-14 19:41:07 +08:00
full_widening.ll [NFCI] SCEVExpander: emit intrinsics for integral {u,s}{min,max} SCEV expressions 2021-03-06 21:52:46 +03:00
indirectbr.ll
infer-poison-flags.ll [Test] Auto-update for some tests 2020-10-14 17:03:33 +07:00
interesting-invoke-use.ll OpaquePtr: Update more tests to use typed sret 2020-11-20 20:08:43 -05:00
invalidate-modified-lcssa-phi.ll [IndVars] Invalidate SCEV when IR is changed in rewriteLoopExitValue. 2021-10-20 20:48:33 +01:00
iterationCount_zext_or_trunc.ll
iv-fold.ll
iv-sext.ll
iv-widen-elim-ext.ll
iv-zext.ll
lcssa-preservation.ll [IndVars] Make sure header phi simplification preserves LCSSA form 2022-07-14 11:46:48 +02:00
lftr-address-space-pointers.ll [ValueTracking] Enable -branch-on-poison-as-ub by default 2022-06-01 10:46:06 +02:00
lftr-dead-ivs.ll [Test] Auto-update for some tests 2020-10-14 17:03:33 +07:00
lftr-multi-exit.ll [NFCI] SCEVExpander: emit intrinsics for integral {u,s}{min,max} SCEV expressions 2021-03-06 21:52:46 +03:00
lftr-opaque-pointers.ll [ConstantFold] Fold zero-index GEPs with opaque pointers 2022-04-04 13:04:27 +02:00
lftr-pr20680.ll
lftr-pr31181.ll [Test] Auto-update for some tests 2020-10-14 17:03:33 +07:00
lftr-pr41998.ll
lftr-promote.ll
lftr-reuse.ll [ValueTracking] Enable -branch-on-poison-as-ub by default 2022-06-01 10:46:06 +02:00
lftr.ll [indvars] Fix lftr crash when preheader is terminated by switch 2021-11-23 09:58:46 -08:00
lftr_disabled.ll
loop-predication.ll [SCEV] Use umin_seq for BECount of multi-exit loops 2022-05-21 15:48:14 +02:00
loop_evaluate7.ll
loop_evaluate8.ll
loop_evaluate9.ll OpaquePtr: Bulk update tests to use typed byval 2020-11-20 14:00:46 -05:00
loop_evaluate11.ll
loop_evaluate_1.ll [SimplifyCFG] Teach FoldTwoEntryPHINode() to preserve DomTree 2020-12-20 00:18:33 +03:00
loop_evaluate_2.ll [test] Fixup tests with -analyze in llvm/test/Transforms 2021-09-04 16:45:51 -07:00
loop_evaluate_3.ll
loop_evaluate_4.ll
loop_evaluate_5.ll
loop_evaluate_6.ll
lrev-existing-umin.ll
masked-iv.ll
monotonic_checks.ll Return "[IndVars] Remove monotonic checks with unknown exit count" 2020-10-28 18:51:40 +07:00
negative_ranges.ll [SCEV] Generalize implication when signedness of FoundPred doesn't matter 2021-09-21 11:17:56 +07:00
no-iv-rewrite.ll [IndVars] Simplify instructions after replacing header phi with preheader value 2022-07-13 10:27:04 +02:00
opaque-ptr.ll [SCEVExpander][OpaquePtr] Check GEP source type when finding identical GEP 2022-02-17 08:48:11 -08:00
outer_phi.ll [SCEV] Prove implication of predicates to their sign-flipped counterparts 2021-10-15 11:49:18 +07:00
phi-select.ll [IndVars] Add test for crash exposed by D114650. 2022-04-22 10:44:29 +01:00
phi-uses-value-multiple-times.ll
post-inc-range.ll [SCEV] Use umin_seq for BECount of multi-exit loops 2022-05-21 15:48:14 +02:00
pr18223.ll [Test] Auto-generated checks for some IndVarSimplify tests 2020-09-08 11:15:40 +07:00
pr22222.ll [IndVars] Simplify instructions after replacing header phi with preheader value 2022-07-13 10:27:04 +02:00
pr24783.ll [ValueTracking] Enable -branch-on-poison-as-ub by default 2022-06-01 10:46:06 +02:00
pr24952.ll
pr25060.ll
pr25578.ll
pr26974.ll
pr28705.ll
pr32045.ll
pr38674.ll
pr38855.ll
pr39673.ll
pr40454.ll [IndVars] Simplify instructions after replacing header phi with preheader value 2022-07-13 10:27:04 +02:00
pr45835.ll [IndVarSimplify] Regenerate test checks (NFC) 2022-05-11 12:20:53 +02:00
pr50506.ll [SCEVExpander] Make CanonicalMode handing in isSafeToExpand() more robust (PR50506) 2022-07-14 14:41:51 +02:00
pr54434.ll [SCEV] Use constant ranges when determining reachable blocks (PR54434) 2022-03-18 12:04:35 +01:00
pr55689.ll [Test] Add XFAIL test for PR55689 2022-06-08 16:01:29 +07:00
pr55925.ll [IndVarSimplify] Don't assert that terminator is not SCEVable (PR55925) 2022-06-09 10:12:13 +02:00
pr56242.ll [SCEV] Fix isImpliedViaMerge() with values from previous iteration (PR56242) 2022-07-05 15:31:23 +02:00
predicated_ranges.ll [IndVars] Use isLoopBackedgeGuardedByCond for last iteration check 2020-11-26 12:37:21 +07:00
preserve-memoryssa.ll
preserve-signed-wrap.ll
promote-iv-to-eliminate-casts.ll [SCEVExpander] Drop poison generating flags when reusing instructions 2021-11-29 15:23:34 -08:00
replace-loop-exit-folds.ll [NFCI] SCEVExpander: emit intrinsics for integral {u,s}{min,max} SCEV expressions 2021-03-06 21:52:46 +03:00
replace-sdiv-by-udiv.ll
replace-srem-by-urem.ll
rewrite-loop-exit-value.ll
rewrite-loop-exit-values-phi.ll [IndVarSimplify] Fix Modified status when handling dead PHI nodes 2020-11-26 14:28:21 +01:00
rlev-add-me.ll
scev-expander-preserve-lcssa.ll [IndVars] Simplify instructions after replacing header phi with preheader value 2022-07-13 10:27:04 +02:00
scevexpander-phi-base-case.ll
sentinel.ll [IndVars] Simplify instructions after replacing header phi with preheader value 2022-07-13 10:27:04 +02:00
shared-exit-between-nested-loop.ll [IndVarSimplify] Notify top most loop to drop cached exit counts 2020-11-19 15:37:54 +08:00
sharpen-range.ll
shift-range-checks.ll [SCEV] Use lshr in implications 2022-01-25 13:25:19 +07:00
shrunk-constant.ll [test] Fixup tests with -analyze in llvm/test/Transforms 2021-09-04 16:45:51 -07:00
signed-trip-count.ll [IndVars] Don't widen pointers in WidenIV::getWideRecurrence 2021-07-11 17:04:50 -07:00
simplify-pointer-arithmetic.ll [IndVars] Add test cases inspired by PR48965. 2021-02-25 15:54:18 +00:00
single-element-range.ll
sink-alloca.ll
sink-from-preheader.ll
sink-trapping.ll
strengthen-overflow.ll autogen tests for ease of update 2021-10-14 13:04:22 -07:00
tripcount_compute.ll
tripcount_infinite.ll [NFCI][SimplifyCFG] Mark all the SimplifyCFG tests that already don't invalidate DomTree as such 2020-12-17 01:03:49 +03:00
trivial-checks.ll [Test] Add tests showing that IndVars cannot prove (X + 1 > X) 2020-09-17 22:37:43 +07:00
trivial-guard.ll [SCEV] Add false->any implication 2021-03-19 11:29:48 +07:00
udiv-invariant-but-traps.ll
udiv.ll
ult-sub-to-eq.ll
use-range-metadata.ll
variable-stride-ivs-0.ll
widen-i32-i8ptr.ll Reland [SCEV] Improve modelling for (null) pointer constants 2021-03-13 16:05:34 +03:00
zext-nuw.ll [IndVars] Regenerate test checks (NFC) 2020-11-02 22:31:11 +01:00