1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00
llvm-mirror/lib/Transforms/Scalar
Bruno Cardoso Lopes cc3be5ce55 Reintroduce "[SCCP] Propagate integer range info for parameters in IPSCCP."
This is r315288 & r315294, which were reverted due to stage2 bot
failures.

Summary:
This updates the SCCP solver to use of the ValueElement lattice for
parameters, which provides integer range information. The range
information is used to remove unneeded icmp instructions.

For the following function, f() can be optimized to `ret i32 2` with
this change

  source_filename = "sccp.c"
  target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
  target triple = "x86_64-unknown-linux-gnu"

  ; Function Attrs: norecurse nounwind readnone uwtable
  define i32 @main() local_unnamed_addr #0 {
  entry:
    %call = tail call fastcc i32 @f(i32 1)
    %call1 = tail call fastcc i32 @f(i32 47)
    %add3 = add nsw i32 %call, %call1
    ret i32 %add3
  }

  ; Function Attrs: noinline norecurse nounwind readnone uwtable
  define internal fastcc i32 @f(i32 %x) unnamed_addr #1 {
  entry:
    %c1 = icmp sle i32 %x, 100

    %cmp = icmp sgt i32 %x, 300
    %. = select i1 %cmp, i32 1, i32 2
    ret i32 %.
  }

  attributes #1 = { noinline }

Reviewers: davide, sanjoy, efriedma, dberlin

Reviewed By: davide, dberlin

Subscribers: mcrosier, gberry, mssimpso, dberlin, llvm-commits

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

llvm-svn: 315593
2017-10-12 16:54:11 +00:00
..
ADCE.cpp [ADCE][Dominators] Reapply: Teach ADCE to preserve dominators 2017-08-22 16:30:21 +00:00
AlignmentFromAssumptions.cpp Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
BDCE.cpp [BDCE] Don't check demanded bits on unsized types 2017-08-16 16:09:22 +00:00
CMakeLists.txt [DivRempairs] add a pass to optimize div/rem pairs (PR31028) 2017-09-09 13:38:18 +00:00
ConstantHoisting.cpp [Transforms] Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes (NFC). 2017-09-13 21:43:53 +00:00
ConstantProp.cpp Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
CorrelatedValuePropagation.cpp Revert r314435: "[JumpThreading] Preserve DT and LVI across the pass" 2017-09-30 11:57:19 +00:00
DCE.cpp Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
DeadStoreElimination.cpp [DSE] Merge stores when the later store only writes to memory locations the early store also wrote to (2nd try) 2017-09-26 13:54:28 +00:00
DivRemPairs.cpp [DivRempairs] add a pass to optimize div/rem pairs (PR31028) 2017-09-09 13:38:18 +00:00
EarlyCSE.cpp [EarlyCSE] Handle calls with no MemorySSA info. 2017-07-14 20:13:21 +00:00
FlattenCFGPass.cpp Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
Float2Int.cpp [Float2Int] Replace a ConstantRange copy with a move. Remove an extra call to MapVector::find. 2017-05-05 17:09:29 +00:00
GuardWidening.cpp Guard print() functions only used by dump() functions. 2017-07-31 10:07:49 +00:00
GVN.cpp [dump] Remove NDEBUG from test to enable dump methods [NFC] 2017-10-12 16:16:06 +00:00
GVNHoist.cpp [GVNHoist] Factor out reachability to search for anticipable instructions quickly 2017-09-13 05:28:03 +00:00
GVNSink.cpp GVNSink: Make ModelledPHIs constructor linear (and avoid edge case it worries about) by avoiding getIncomingValueForBlock 2017-09-20 00:07:27 +00:00
InductiveRangeCheckElimination.cpp [IRCE] Do not process empty safe ranges 2017-10-11 06:53:07 +00:00
IndVarSimplify.cpp [SimplifyIndVar] Replace IVUsers with loop invariant whenever possible 2017-10-12 02:54:11 +00:00
InferAddressSpaces.cpp Sink some IntrinsicInst.h and Intrinsics.h out of llvm/include 2017-09-07 23:27:44 +00:00
IVUsersPrinter.cpp [PM] Separate the LoopAnalysisManager from the LoopPassManager and move 2017-01-11 09:43:56 +00:00
JumpThreading.cpp Revert r314435: "[JumpThreading] Preserve DT and LVI across the pass" 2017-09-30 11:57:19 +00:00
LICM.cpp [NFC] Convert OptimizationRemarkEmitter old emit() calls to new closure 2017-10-11 17:12:59 +00:00
LLVMBuild.txt
LoopAccessAnalysisPrinter.cpp [PM] Separate the LoopAnalysisManager from the LoopPassManager and move 2017-01-11 09:43:56 +00:00
LoopDataPrefetch.cpp [NFC] Convert OptimizationRemarkEmitter old emit() calls to new closure 2017-10-11 17:12:59 +00:00
LoopDeletion.cpp [LoopDeletion] Move deleteDeadLoop to to LoopUtils. NFC 2017-10-04 20:42:46 +00:00
LoopDistribute.cpp [NFC] Convert OptimizationRemarkEmitter old emit() calls to new closure 2017-10-11 17:12:59 +00:00
LoopIdiomRecognize.cpp [LIR] Teach LIR to avoid extending the BE count prior to adding one to 2017-07-25 10:48:32 +00:00
LoopInstSimplify.cpp Kill off the old SimplifyInstruction API by converting remaining users. 2017-04-28 19:55:38 +00:00
LoopInterchange.cpp [NFC] Convert OptimizationRemarkEmitter old emit() calls to new closure 2017-10-11 17:12:59 +00:00
LoopLoadElimination.cpp Add a getPointerOperandType() helper to LoadInst and StoreInst; NFC 2017-04-18 22:00:54 +00:00
LoopPassManager.cpp [PM] Teach LoopUnroll to update the LPM infrastructure as it unrolls 2017-01-25 02:49:01 +00:00
LoopPredication.cpp Rework loop predication pass 2017-09-22 13:13:57 +00:00
LoopRerollPass.cpp Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
LoopRotation.cpp [LoopRotate][Dominators] Use the incremental API to update DomTree 2017-08-17 21:48:19 +00:00
LoopSimplifyCFG.cpp Rename WeakVH to WeakTrackingVH; NFC 2017-05-01 17:07:49 +00:00
LoopSink.cpp [PM] Port LoopSink to the new pass manager. 2017-01-20 08:42:19 +00:00
LoopStrengthReduce.cpp [dump] Remove NDEBUG from test to enable dump methods [NFC] 2017-10-12 16:16:06 +00:00
LoopUnrollPass.cpp [NFC] Convert OptimizationRemarkEmitter old emit() calls to new closure 2017-10-11 17:12:59 +00:00
LoopUnswitch.cpp Use a BumpPtrAllocator for Loop objects 2017-09-28 02:45:42 +00:00
LoopVersioningLICM.cpp
LowerAtomic.cpp LowerAtomic: Don't skip optnone functions; atomic still need lowering (PR34020) 2017-08-23 15:43:28 +00:00
LowerExpectIntrinsic.cpp Fix builin_expect lowering bug 2017-06-07 18:32:24 +00:00
LowerGuardIntrinsic.cpp Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
MemCpyOptimizer.cpp Default MemoryLocation passed to getModRefInfo should be None (D35441) 2017-08-01 00:47:17 +00:00
MergedLoadStoreMotion.cpp [IR] Make use of Type::isPtrOrPtrVectorTy/isIntOrIntVectorTy/isFPOrFPVectorTy to shorten code. NFC 2017-07-09 07:04:00 +00:00
MergeICmps.cpp Re-land "[MergeICmps] Disable mergeicmps if the target does not want to handle memcmp expansion." 2017-10-10 08:00:45 +00:00
NaryReassociate.cpp Recommit : Use the basic cost if a GEP is not used as addressing mode 2017-10-04 18:33:52 +00:00
NewGVN.cpp NewGVN: Factor out duplicate parts of OpIsSafeForPHIOfOps 2017-10-06 01:33:06 +00:00
PartiallyInlineLibCalls.cpp Rename AttributeSet to AttributeList 2017-03-21 16:57:19 +00:00
PlaceSafepoints.cpp All libcalls should be considered to be GC-leaf functions. 2017-07-27 16:49:39 +00:00
Reassociate.cpp [Reassociate] Do not drop debug location if replacement is missing 2017-08-24 09:05:00 +00:00
Reg2Mem.cpp Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
RewriteStatepointsForGC.cpp [Analysis, Transforms] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-09-01 21:37:29 +00:00
Scalar.cpp [DivRempairs] add a pass to optimize div/rem pairs (PR31028) 2017-09-09 13:38:18 +00:00
Scalarizer.cpp Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
SCCP.cpp Reintroduce "[SCCP] Propagate integer range info for parameters in IPSCCP." 2017-10-12 16:54:11 +00:00
SeparateConstOffsetFromGEP.cpp Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
SimpleLoopUnswitch.cpp Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
SimplifyCFGPass.cpp [SimplifyCFG] put the optional assumption cache pointer in the options struct; NFCI 2017-10-04 20:26:25 +00:00
Sink.cpp [Sink] Fix predicate in legality check 2017-06-09 19:31:10 +00:00
SpeculativeExecution.cpp Revert r301950: SpeculativeExecution: Stop using whitelist for costs 2017-05-10 12:30:07 +00:00
SROA.cpp [dump] Remove NDEBUG from test to enable dump methods [NFC] 2017-10-12 16:16:06 +00:00
StraightLineStrengthReduce.cpp Recommit : Use the basic cost if a GEP is not used as addressing mode 2017-10-04 18:33:52 +00:00
StructurizeCFG.cpp fix trivial typos; NFC 2017-07-09 05:54:44 +00:00
TailRecursionElimination.cpp [NFC] Convert OptimizationRemarkEmitter old emit() calls to new closure 2017-10-11 17:12:59 +00:00