mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-24 05:23:45 +02:00
2bac40ee1c
This change is motivated by the case when IndVarSimplify doesn't widen a comparison of IV increment because it can't prove IV increment being non-negative. We end up with a redundant trunc of the widened increment on this example. for.body: %i = phi i32 [ %start, %for.body.lr.ph ], [ %i.inc, %for.inc ] %within_limits = icmp ult i32 %i, 64 br i1 %within_limits, label %continue, label %for.end continue: %i.i64 = zext i32 %i to i64 %arrayidx = getelementptr inbounds i32, i32* %base, i64 %i.i64 %val = load i32, i32* %arrayidx, align 4 br label %for.inc for.inc: %i.inc = add nsw nuw i32 %i, 1 %cmp = icmp slt i32 %i.inc, %limit br i1 %cmp, label %for.body, label %for.end There is a range check inside of the loop which guarantees the IV to be non-negative. NSW on the increment guarantees that the increment is also non-negative. Teach IndVarSimplify to use the range check to prove non-negativity of loop increments. Reviewed By: sanjoy Differential Revision: https://reviews.llvm.org/D25738 llvm-svn: 284629 |
||
---|---|---|
.. | ||
ADCE.cpp | ||
AlignmentFromAssumptions.cpp | ||
BDCE.cpp | ||
CMakeLists.txt | ||
ConstantHoisting.cpp | ||
ConstantProp.cpp | ||
CorrelatedValuePropagation.cpp | ||
DCE.cpp | ||
DeadStoreElimination.cpp | ||
EarlyCSE.cpp | ||
FlattenCFGPass.cpp | ||
Float2Int.cpp | ||
GuardWidening.cpp | ||
GVN.cpp | ||
GVNHoist.cpp | ||
InductiveRangeCheckElimination.cpp | ||
IndVarSimplify.cpp | ||
JumpThreading.cpp | ||
LICM.cpp | ||
LLVMBuild.txt | ||
LoadCombine.cpp | ||
LoopDataPrefetch.cpp | ||
LoopDeletion.cpp | ||
LoopDistribute.cpp | ||
LoopIdiomRecognize.cpp | ||
LoopInstSimplify.cpp | ||
LoopInterchange.cpp | ||
LoopLoadElimination.cpp | ||
LoopRerollPass.cpp | ||
LoopRotation.cpp | ||
LoopSimplifyCFG.cpp | ||
LoopStrengthReduce.cpp | ||
LoopUnrollPass.cpp | ||
LoopUnswitch.cpp | ||
LoopVersioningLICM.cpp | ||
LowerAtomic.cpp | ||
LowerExpectIntrinsic.cpp | ||
LowerGuardIntrinsic.cpp | ||
MemCpyOptimizer.cpp | ||
MergedLoadStoreMotion.cpp | ||
NaryReassociate.cpp | ||
PartiallyInlineLibCalls.cpp | ||
PlaceSafepoints.cpp | ||
Reassociate.cpp | ||
Reg2Mem.cpp | ||
RewriteStatepointsForGC.cpp | ||
Scalar.cpp | ||
Scalarizer.cpp | ||
SCCP.cpp | ||
SeparateConstOffsetFromGEP.cpp | ||
SimplifyCFGPass.cpp | ||
Sink.cpp | ||
SpeculativeExecution.cpp | ||
SROA.cpp | ||
StraightLineStrengthReduce.cpp | ||
StructurizeCFG.cpp | ||
TailRecursionElimination.cpp |