llvm-project/llvm/lib/Transforms/Scalar
Jakub Kuderski d869913f3b [Dominators] Teach LoopDeletion to use the new incremental API
Summary:
This patch makes LoopDeletion use the incremental DominatorTree API.

We modify LoopDeletion to perform the deletion in 5 steps:
1. Create a new dummy edge from the preheader to the exit, by adding a conditional branch.
2. Inform the DomTree about the new edge.
3. Remove the conditional branch and replace it with an unconditional edge to the exit. This removes the edge to the loop header, making it unreachable.
4. Inform the DomTree about the deleted edge.
5. Remove the unreachable block from the function.

Creating the dummy conditional branch is necessary to perform incremental DomTree update.
We should consider using the batch updater when it's ready.

Reviewers: dberlin, davide, grosser, sanjoy

Reviewed By: dberlin, grosser

Subscribers: mzolotukhin, llvm-commits

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

llvm-svn: 309850
2017-08-02 18:17:52 +00:00
..
ADCE.cpp [ADCE] Remove redundent code [NFC] 2017-03-16 03:59:23 +00:00
AlignmentFromAssumptions.cpp Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
BDCE.cpp [PM] Introduce an analysis set used to preserve all analyses over 2017-01-15 06:32:49 +00:00
CMakeLists.txt Remove the LoadCombine pass. It was never enabled and is unsupported. 2017-06-22 22:58:12 +00:00
ConstantHoisting.cpp [ConstantHoisting] Remove dupliate logic in constant hoisting 2017-07-10 20:45:34 +00:00
ConstantProp.cpp Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
CorrelatedValuePropagation.cpp [CorrelatedValuePropagation] Fix typo in comment sense->since. NFC 2017-06-23 20:28:40 +00:00
DCE.cpp Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
DeadStoreElimination.cpp Cleanup in preparation for D30703. NFCI 2017-03-29 14:42:27 +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
GVN.cpp [GVN] Recommit the patch "Add phi-translate support in scalarpre" 2017-07-28 15:47:25 +00:00
GVNHoist.cpp Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
GVNSink.cpp Hide dbgs() stream for when built with -fmodules. 2017-06-14 19:16:22 +00:00
GuardWidening.cpp Guard print() functions only used by dump() functions. 2017-07-31 10:07:49 +00:00
IVUsersPrinter.cpp [PM] Separate the LoopAnalysisManager from the LoopPassManager and move 2017-01-11 09:43:56 +00:00
IndVarSimplify.cpp [IndVars] Add an option to be able to disable LFTR 2017-06-09 06:11:59 +00:00
InductiveRangeCheckElimination.cpp [IRCE][NFC] Add another assert that AddRecExpr's step is not zero 2017-08-01 06:49:29 +00:00
InferAddressSpaces.cpp [InferAddressSpaces] Fix assertion about null pointer 2017-07-07 02:40:13 +00:00
JumpThreading.cpp [Value Tracking] Default argument to true and rename accordingly. NFC. 2017-08-01 20:18:54 +00:00
LICM.cpp [LICM] Make sinkRegion and hoistRegion non-recursive 2017-07-20 03:27:02 +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 Revert @llvm.assume with operator bundles (r289755-r289757) 2016-12-19 08:22:17 +00:00
LoopDeletion.cpp [Dominators] Teach LoopDeletion to use the new incremental API 2017-08-02 18:17:52 +00:00
LoopDistribute.cpp Add a wrapper around copy_if in STLExtras; NFC 2017-02-21 00:38:44 +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 [LoopInterchange] Do not interchange loops with function calls. 2017-07-31 09:00:52 +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 Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
LoopRerollPass.cpp Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
LoopRotation.cpp [LoopRotate] Fix DomTree update logic for unreachable nodes. Fix PR33701. 2017-07-12 18:42:16 +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 Extend ifdefs to more unused helper functions. 2017-07-31 16:11:43 +00:00
LoopUnrollPass.cpp [LoopUnroll] Fix bug in computeUnrollCount causing it to not honor MaxCount 2017-06-28 17:01:15 +00:00
LoopUnswitch.cpp Disable loop unswitching for some patterns containing equality comparison with undef. 2017-07-25 23:37:17 +00:00
LoopVersioningLICM.cpp [LoopVersioning] Require loop-simplify form for loop versioning. 2016-12-19 17:13:37 +00:00
LowerAtomic.cpp
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
NaryReassociate.cpp Rename WeakVH to WeakTrackingVH; NFC 2017-05-01 17:07:49 +00:00
NewGVN.cpp [NewGVN] Fold single-use variables. NFCI. 2017-08-02 04:05:49 +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 [Constants] If we already have a ConstantInt*, prefer to use isZero/isOne/isMinusOne instead of isNullValue/isOneValue/isAllOnesValue inherited from Constant. NFCI 2017-07-06 18:39:47 +00:00
Reg2Mem.cpp Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
RewriteStatepointsForGC.cpp All libcalls should be considered to be GC-leaf functions. 2017-07-27 16:49:39 +00:00
SCCP.cpp [IPSCCP] Guard a user of getInitializer with hasDefinitiveInitializer 2017-07-31 17:47:07 +00:00
SROA.cpp Enhance synchscope representation 2017-07-11 22:23:00 +00:00
Scalar.cpp Remove the LoadCombine pass. It was never enabled and is unsupported. 2017-06-22 22:58:12 +00:00
Scalarizer.cpp Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +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 Split the SimplifyCFG pass into two variants. 2017-03-26 06:44:08 +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
StraightLineStrengthReduce.cpp [IR] De-virtualize ~Value to save a vptr 2017-05-18 17:24:10 +00:00
StructurizeCFG.cpp fix trivial typos; NFC 2017-07-09 05:54:44 +00:00
TailRecursionElimination.cpp [TRE] Move to the new OptRemark API. 2017-07-19 21:13:22 +00:00