llvm-project/llvm/lib/Transforms/Scalar
Nikita Popov 46d4dba6e6 [IndVarSimplify] Fixup nowrap flags during LFTR (PR31181)
Fix for https://bugs.llvm.org/show_bug.cgi?id=31181 and partial fix
for LFTR poison handling issues in general.

When LFTR moves a condition from pre-inc to post-inc, it may now
depend on value that is poison due to nowrap flags. To avoid this,
we clear any nowrap flag that SCEV cannot prove for the post-inc
addrec.

Additionally, LFTR may switch to a different IV that is dynamically
dead and as such may be arbitrarily poison. This patch will correct
nowrap flags in some but not all cases where this happens. This is
related to the adoption of IR nowrap flags for the pre-inc addrec.
(See some of the switch_to_different_iv tests, where flags are not
dropped or insufficiently dropped.)

Finally, there are likely similar issues with the handling of GEP
inbounds, but we don't have a test case for this yet.

Differential Revision: https://reviews.llvm.org/D60935

llvm-svn: 362292
2019-06-01 09:40:18 +00:00
..
ADCE.cpp Move DomTreeUpdater from IR to Analysis 2019-02-06 02:52:52 +00:00
AlignmentFromAssumptions.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
BDCE.cpp [BDCE] Optimize find+insert with early insert 2019-03-07 06:38:03 +00:00
CMakeLists.txt Add basic loop fusion pass. 2019-04-17 18:53:27 +00:00
CallSiteSplitting.cpp CallSiteSplitting: Respect convergent and noduplicate 2019-05-29 16:59:48 +00:00
ConstantHoisting.cpp Use llvm::stable_sort 2019-04-23 14:51:27 +00:00
ConstantProp.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
CorrelatedValuePropagation.cpp Reapply [CVP] Simplify non-overflowing saturating add/sub 2019-05-31 20:48:26 +00:00
DCE.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
DeadStoreElimination.cpp [DSE] Bugfix to avoid PartialStoreMerging involving non byte-sized stores 2019-05-24 08:32:02 +00:00
DivRemPairs.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
EarlyCSE.cpp [EarlyCSE] detect equivalence of selects with inverse conditions and commuted operands (PR41101) 2019-04-16 20:41:20 +00:00
FlattenCFGPass.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Float2Int.cpp [ConstantRange] Add getFull() + getEmpty() named constructors; NFC 2019-03-24 09:34:40 +00:00
GVN.cpp GVN: Handle addrspacecast 2019-05-18 14:36:06 +00:00
GVNHoist.cpp Use llvm::stable_sort 2019-04-23 14:51:27 +00:00
GVNSink.cpp Use llvm::stable_sort 2019-04-23 14:51:27 +00:00
GuardWidening.cpp [GuardWidening] Wire up a NPM version of the LoopGuardWidening pass 2019-04-18 19:17:14 +00:00
IVUsersPrinter.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
IndVarSimplify.cpp [IndVarSimplify] Fixup nowrap flags during LFTR (PR31181) 2019-06-01 09:40:18 +00:00
InductiveRangeCheckElimination.cpp [MemorySSA] Teach LoopSimplify to preserve MemorySSA. 2019-05-08 17:05:36 +00:00
InferAddressSpaces.cpp [InferAddressSpaces] Enhance the handling of cosntexpr. 2019-05-10 14:57:42 +00:00
InstSimplifyPass.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
JumpThreading.cpp [JumpThreading] A bug fix for stale loop info after unfold select 2019-05-15 15:15:16 +00:00
LICM.cpp [LICM] Allow AliasSetMap to contain top-level loops. 2019-05-14 19:41:36 +00:00
LLVMBuild.txt Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
LoopAccessAnalysisPrinter.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
LoopDataPrefetch.cpp [opaque pointer types] Pass function types to CallInst creation. 2019-02-01 20:43:25 +00:00
LoopDeletion.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
LoopDistribute.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
LoopFuse.cpp Fix unused variable warning in LoopFusion pass. 2019-04-25 02:10:02 +00:00
LoopIdiomRecognize.cpp [LoopIdiom] Basic OptimizationRemarkEmitter handling 2019-05-30 13:02:06 +00:00
LoopInstSimplify.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
LoopInterchange.cpp [LoopInterchange] Fix handling of LCSSA nodes defined in headers and latches. 2019-05-26 23:38:25 +00:00
LoopLoadElimination.cpp [PGO] Profile guided code size optimization. 2019-04-15 16:49:00 +00:00
LoopPassManager.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
LoopPredication.cpp Inline variable into assert to fix unused variable warning. 2019-06-01 03:32:20 +00:00
LoopRerollPass.cpp [LoopReroll] Fix reroll root legality checking. 2019-02-12 00:33:25 +00:00
LoopRotation.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
LoopSimplifyCFG.cpp [LoopSimplifyCFG] Suppress expensive DomTree verification 2019-04-29 13:29:55 +00:00
LoopSink.cpp Use llvm::stable_sort 2019-04-23 14:51:27 +00:00
LoopStrengthReduce.cpp Revert "[LSR] Tweak setup cost depth threshold to 10." 2019-05-13 15:37:18 +00:00
LoopUnrollAndJamPass.cpp [PGO] Profile guided code size optimization. 2019-04-15 16:49:00 +00:00
LoopUnrollPass.cpp [NewPassManager] Add tuning option: ForgetAllSCEVInLoopUnroll [NFC]. 2019-05-23 21:52:59 +00:00
LoopUnswitch.cpp [IR] Refactor attribute methods in Function class (NFC) 2019-04-04 22:40:06 +00:00
LoopVersioningLICM.cpp LoopVersioningLICM: Respect convergent and noduplicate 2019-05-29 20:47:59 +00:00
LowerAtomic.cpp Transforms: lower fadd and fsub atomicrmw instructions 2019-05-23 17:03:43 +00:00
LowerExpectIntrinsic.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
LowerGuardIntrinsic.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
LowerWidenableCondition.cpp Update more files added with the old header to the new one. 2019-02-11 08:25:56 +00:00
MakeGuardsExplicit.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
MemCpyOptimizer.cpp [opaque pointer types] Pass value type to GetElementPtr creation. 2019-02-01 20:44:47 +00:00
MergeICmps.cpp [MergeICmps] Make the pass compatible with the new pass manager. 2019-05-23 12:35:26 +00:00
MergedLoadStoreMotion.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
NaryReassociate.cpp [opaque pointer types] Pass value type to GetElementPtr creation. 2019-02-01 20:44:47 +00:00
NewGVN.cpp [IR] Add WithOverflowInst class 2019-04-16 18:55:16 +00:00
PartiallyInlineLibCalls.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
PlaceSafepoints.cpp [CallSite removal] Migrate the statepoint GC infrastructure to use the 2019-02-11 07:42:30 +00:00
Reassociate.cpp [Reassociation] Place moved instructions after landing pads 2019-05-08 15:44:24 +00:00
Reg2Mem.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
RewriteStatepointsForGC.cpp [CallSite removal] Migrate the statepoint GC infrastructure to use the 2019-02-11 07:42:30 +00:00
SCCP.cpp [SCCP] Fix crash when trying to constant-fold terminators multiple times. 2019-05-08 09:09:54 +00:00
SROA.cpp Use the DataLayout::typeSizeEqualsStoreSize helper. NFC 2019-05-24 09:20:20 +00:00
Scalar.cpp [MergeICmps] Make the pass compatible with the new pass manager. 2019-05-23 12:35:26 +00:00
Scalarizer.cpp Use the DataLayout::typeSizeEqualsStoreSize helper. NFC 2019-05-24 09:20:20 +00:00
SeparateConstOffsetFromGEP.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
SimpleLoopUnswitch.cpp Use llvm::stable_sort 2019-04-23 14:51:27 +00:00
SimplifyCFGPass.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Sink.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
SpeculateAroundPHIs.cpp SpeculateAroundPHIs: Respect convergent 2019-05-29 13:14:39 +00:00
SpeculativeExecution.cpp Support FNeg in SpeculativeExecution pass 2019-05-14 16:51:18 +00:00
StraightLineStrengthReduce.cpp [opaque pointer types] Pass value type to GetElementPtr creation. 2019-02-01 20:44:47 +00:00
StructurizeCFG.cpp StructurizeCFG: Relax uniformity checks. 2019-05-24 08:59:17 +00:00
TailRecursionElimination.cpp [DTU] Deprecate insertEdge*/deleteEdge* 2019-02-22 05:41:43 +00:00
WarnMissedTransforms.cpp [IR] Refactor attribute methods in Function class (NFC) 2019-04-04 22:40:06 +00:00