llvm.org GIT mirror llvm / c8ce053
Revert '[LICM] Make Loop ICM profile aware' and 'Fix pass dependency for LICM' This reverts r368526 (git commit 7e71aa24bc0788690fea7f0d7eab400c6a784deb) This reverts r368542 (git commit cb5a90fd314a7914cf293797bb4fd7a6841052cf) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368800 91177308-0d34-0410-b5e6-96231b3b80d8 David L. Jones a month ago
7 changed file(s) with 32 addition(s) and 126 deletion(s). Raw diff Collapse all Expand all
3636 class AliasSet;
3737 class AliasSetTracker;
3838 class BasicBlock;
39 class BlockFrequencyInfo;
4039 class DataLayout;
4140 class Loop;
4241 class LoopInfo;
114113 /// reverse depth first order w.r.t the DominatorTree. This allows us to visit
115114 /// uses before definitions, allowing us to sink a loop body in one pass without
116115 /// iteration. Takes DomTreeNode, AliasAnalysis, LoopInfo, DominatorTree,
117 /// BlockFrequencyInfo, TargetLibraryInfo, Loop, AliasSet information for all
116 /// DataLayout, TargetLibraryInfo, Loop, AliasSet information for all
118117 /// instructions of the loop and loop safety information as
119118 /// arguments. Diagnostics is emitted via \p ORE. It returns changed status.
120119 bool sinkRegion(DomTreeNode *, AliasAnalysis *, LoopInfo *, DominatorTree *,
121 BlockFrequencyInfo *, TargetLibraryInfo *, TargetTransformInfo *,
122 Loop *, AliasSetTracker *, MemorySSAUpdater *, ICFLoopSafetyInfo *,
120 TargetLibraryInfo *, TargetTransformInfo *, Loop *,
121 AliasSetTracker *, MemorySSAUpdater *, ICFLoopSafetyInfo *,
123122 SinkAndHoistLICMFlags &, OptimizationRemarkEmitter *);
124123
125124 /// Walk the specified region of the CFG (defined by all blocks
126125 /// dominated by the specified block, and that are in the current loop) in depth
127126 /// first order w.r.t the DominatorTree. This allows us to visit definitions
128127 /// before uses, allowing us to hoist a loop body in one pass without iteration.
129 /// Takes DomTreeNode, AliasAnalysis, LoopInfo, DominatorTree, BlockFrequencyInfo,
128 /// Takes DomTreeNode, AliasAnalysis, LoopInfo, DominatorTree, DataLayout,
130129 /// TargetLibraryInfo, Loop, AliasSet information for all instructions of the
131130 /// loop and loop safety information as arguments. Diagnostics is emitted via \p
132131 /// ORE. It returns changed status.
133132 bool hoistRegion(DomTreeNode *, AliasAnalysis *, LoopInfo *, DominatorTree *,
134 BlockFrequencyInfo *, TargetLibraryInfo *, Loop *, AliasSetTracker *,
135 MemorySSAUpdater *, ICFLoopSafetyInfo *, SinkAndHoistLICMFlags &,
136 OptimizationRemarkEmitter *);
133 TargetLibraryInfo *, Loop *, AliasSetTracker *,
134 MemorySSAUpdater *, ICFLoopSafetyInfo *,
135 SinkAndHoistLICMFlags &, OptimizationRemarkEmitter *);
137136
138137 /// This function deletes dead loops. The caller of this function needs to
139138 /// guarantee that the loop is infact dead.
9494 "licm-control-flow-hoisting", cl::Hidden, cl::init(false),
9595 cl::desc("Enable control flow (and PHI) hoisting in LICM"));
9696
97 static cl::opt HoistSinkColdnessThreshold(
98 "licm-coldness-threshold", cl::Hidden, cl::init(4),
99 cl::desc("Relative coldness Threshold of hoisting/sinking destination "
100 "block for LICM to be considered beneficial"));
101
10297 static cl::opt MaxNumUsesTraversed(
10398 "licm-max-num-uses-traversed", cl::Hidden, cl::init(8),
10499 cl::desc("Max num uses visited for identifying load "
143138 BasicBlock *Dest, ICFLoopSafetyInfo *SafetyInfo,
144139 MemorySSAUpdater *MSSAU, OptimizationRemarkEmitter *ORE);
145140 static bool sink(Instruction &I, LoopInfo *LI, DominatorTree *DT,
146 BlockFrequencyInfo *BFI, const Loop *CurLoop,
147 ICFLoopSafetyInfo *SafetyInfo, MemorySSAUpdater *MSSAU,
148 OptimizationRemarkEmitter *ORE);
141 const Loop *CurLoop, ICFLoopSafetyInfo *SafetyInfo,
142 MemorySSAUpdater *MSSAU, OptimizationRemarkEmitter *ORE);
149143 static bool isSafeToExecuteUnconditionally(Instruction &Inst,
150144 const DominatorTree *DT,
151145 const Loop *CurLoop,
173167 struct LoopInvariantCodeMotion {
174168 using ASTrackerMapTy = DenseMap>;
175169 bool runOnLoop(Loop *L, AliasAnalysis *AA, LoopInfo *LI, DominatorTree *DT,
176 BlockFrequencyInfo *BFI, TargetLibraryInfo *TLI,
177 TargetTransformInfo *TTI, ScalarEvolution *SE, MemorySSA *MSSA,
170 TargetLibraryInfo *TLI, TargetTransformInfo *TTI,
171 ScalarEvolution *SE, MemorySSA *MSSA,
178172 OptimizationRemarkEmitter *ORE, bool DeleteAST);
179173
180174 ASTrackerMapTy &getLoopToAliasSetMap() { return LoopToAliasSetMap; }
225219 &getAnalysis().getAAResults(),
226220 &getAnalysis().getLoopInfo(),
227221 &getAnalysis().getDomTree(),
228 &getAnalysis().getBFI(),
229222 &getAnalysis().getTLI(),
230223 &getAnalysis().getTTI(
231224 *L->getHeader()->getParent()),
236229 /// loop preheaders be inserted into the CFG...
237230 ///
238231 void getAnalysisUsage(AnalysisUsage &AU) const override {
239 AU.addRequired();
240232 AU.addPreserved();
241233 AU.addPreserved();
242234 AU.addRequired();
293285 "cached at a higher level");
294286
295287 LoopInvariantCodeMotion LICM(LicmMssaOptCap, LicmMssaNoAccForPromotionCap);
296 auto BFI = FAM.getCachedResult(*F);
297 if (!LICM.runOnLoop(&L, &AR.AA, &AR.LI, &AR.DT, BFI, &AR.TLI, &AR.TTI, &AR.SE,
288 if (!LICM.runOnLoop(&L, &AR.AA, &AR.LI, &AR.DT, &AR.TLI, &AR.TTI, &AR.SE,
298289 AR.MSSA, ORE, true))
299290 return PreservedAnalyses::all();
300291
312303 INITIALIZE_PASS_BEGIN(LegacyLICMPass, "licm", "Loop Invariant Code Motion",
313304 false, false)
314305 INITIALIZE_PASS_DEPENDENCY(LoopPass)
315 INITIALIZE_PASS_DEPENDENCY(BlockFrequencyInfoWrapperPass)
316306 INITIALIZE_PASS_DEPENDENCY(TargetLibraryInfoWrapperPass)
317307 INITIALIZE_PASS_DEPENDENCY(TargetTransformInfoWrapperPass)
318308 INITIALIZE_PASS_DEPENDENCY(MemorySSAWrapperPass)
333323 ///
334324 bool LoopInvariantCodeMotion::runOnLoop(
335325 Loop *L, AliasAnalysis *AA, LoopInfo *LI, DominatorTree *DT,
336 BlockFrequencyInfo *BFI, TargetLibraryInfo *TLI, TargetTransformInfo *TTI,
337 ScalarEvolution *SE, MemorySSA *MSSA, OptimizationRemarkEmitter *ORE,
338 bool DeleteAST) {
326 TargetLibraryInfo *TLI, TargetTransformInfo *TTI, ScalarEvolution *SE,
327 MemorySSA *MSSA, OptimizationRemarkEmitter *ORE, bool DeleteAST) {
339328 bool Changed = false;
340329
341330 assert(L->isLCSSAForm(*DT) && "Loop is not in LCSSA form.");
395384 LicmMssaOptCap, LicmMssaNoAccForPromotionCap,
396385 /*IsSink=*/true};
397386 if (L->hasDedicatedExits())
398 Changed |= sinkRegion(DT->getNode(L->getHeader()), AA, LI, DT, BFI, TLI, TTI, L,
387 Changed |= sinkRegion(DT->getNode(L->getHeader()), AA, LI, DT, TLI, TTI, L,
399388 CurAST.get(), MSSAU.get(), &SafetyInfo, Flags, ORE);
400389 Flags.IsSink = false;
401390 if (Preheader)
402 Changed |= hoistRegion(DT->getNode(L->getHeader()), AA, LI, DT, BFI, TLI, L,
391 Changed |= hoistRegion(DT->getNode(L->getHeader()), AA, LI, DT, TLI, L,
403392 CurAST.get(), MSSAU.get(), &SafetyInfo, Flags, ORE);
404393
405394 // Now that all loop invariants have been removed from the loop, promote any
501490 /// definitions, allowing us to sink a loop body in one pass without iteration.
502491 ///
503492 bool llvm::sinkRegion(DomTreeNode *N, AliasAnalysis *AA, LoopInfo *LI,
504 DominatorTree *DT, BlockFrequencyInfo *BFI,
505 TargetLibraryInfo *TLI, TargetTransformInfo *TTI,
506 Loop *CurLoop, AliasSetTracker *CurAST,
507 MemorySSAUpdater *MSSAU,
493 DominatorTree *DT, TargetLibraryInfo *TLI,
494 TargetTransformInfo *TTI, Loop *CurLoop,
495 AliasSetTracker *CurAST, MemorySSAUpdater *MSSAU,
508496 ICFLoopSafetyInfo *SafetyInfo,
509497 SinkAndHoistLICMFlags &Flags,
510498 OptimizationRemarkEmitter *ORE) {
553541 canSinkOrHoistInst(I, AA, DT, CurLoop, CurAST, MSSAU, true, &Flags,
554542 ORE) &&
555543 !I.mayHaveSideEffects()) {
556 if (sink(I, LI, DT, BFI, CurLoop, SafetyInfo, MSSAU, ORE)) {
544 if (sink(I, LI, DT, CurLoop, SafetyInfo, MSSAU, ORE)) {
557545 if (!FreeInLoop) {
558546 ++II;
559547 eraseInstruction(I, *SafetyInfo, CurAST, MSSAU);
797785 };
798786 } // namespace
799787
800 // Hoisting/sinking instruction out of a loop isn't always beneficial. It's only
801 // only worthwhile if the destination block is actually colder than current
802 // block.
803 static bool worthSinkOrHoistInst(Instruction &I, BasicBlock *DstBlock,
804 OptimizationRemarkEmitter *ORE,
805 BlockFrequencyInfo *BFI) {
806 // Check block frequency only when runtime profile is available.
807 // to avoid pathological cases. With static profile, lean towards
808 // hosting because it helps canonicalize the loop for vectorizer.
809 if (!DstBlock->getParent()->hasProfileData())
810 return true;
811
812 if (!HoistSinkColdnessThreshold || !BFI)
813 return true;
814
815 BasicBlock *SrcBlock = I.getParent();
816 if (BFI->getBlockFreq(DstBlock).getFrequency() / HoistSinkColdnessThreshold >
817 BFI->getBlockFreq(SrcBlock).getFrequency()) {
818 ORE->emit([&]() {
819 return OptimizationRemarkMissed(DEBUG_TYPE, "SinkHoistInst", &I)
820 << "failed to sink or hoist instruction because containing block "
821 "has lower frequency than destination block";
822 });
823 return false;
824 }
825
826 return true;
827 }
828
829788 /// Walk the specified region of the CFG (defined by all blocks dominated by
830789 /// the specified block, and that are in the current loop) in depth first
831790 /// order w.r.t the DominatorTree. This allows us to visit definitions before
832791 /// uses, allowing us to hoist a loop body in one pass without iteration.
833792 ///
834793 bool llvm::hoistRegion(DomTreeNode *N, AliasAnalysis *AA, LoopInfo *LI,
835 DominatorTree *DT, BlockFrequencyInfo *BFI,
836 TargetLibraryInfo *TLI, Loop *CurLoop,
794 DominatorTree *DT, TargetLibraryInfo *TLI, Loop *CurLoop,
837795 AliasSetTracker *CurAST, MemorySSAUpdater *MSSAU,
838796 ICFLoopSafetyInfo *SafetyInfo,
839797 SinkAndHoistLICMFlags &Flags,
884842
885843 // Try hoisting the instruction out to the preheader. We can only do
886844 // this if all of the operands of the instruction are loop invariant and
887 // if it is safe to hoist the instruction. We also check block frequency
888 // to make sure instruction only gets hoisted into colder blocks.
845 // if it is safe to hoist the instruction.
889846 // TODO: It may be safe to hoist if we are hoisting to a conditional block
890847 // and we have accurately duplicated the control flow from the loop header
891848 // to that block.
892849 if (CurLoop->hasLoopInvariantOperands(&I) &&
893850 canSinkOrHoistInst(I, AA, DT, CurLoop, CurAST, MSSAU, true, &Flags,
894851 ORE) &&
895 worthSinkOrHoistInst(I, CurLoop->getLoopPreheader(), ORE, BFI) &&
896852 isSafeToExecuteUnconditionally(
897853 I, DT, CurLoop, SafetyInfo, ORE,
898854 CurLoop->getLoopPreheader()->getTerminator())) {
15931549 /// position, and may either delete it or move it to outside of the loop.
15941550 ///
15951551 static bool sink(Instruction &I, LoopInfo *LI, DominatorTree *DT,
1596 BlockFrequencyInfo *BFI, const Loop *CurLoop,
1597 ICFLoopSafetyInfo *SafetyInfo, MemorySSAUpdater *MSSAU,
1598 OptimizationRemarkEmitter *ORE) {
1552 const Loop *CurLoop, ICFLoopSafetyInfo *SafetyInfo,
1553 MemorySSAUpdater *MSSAU, OptimizationRemarkEmitter *ORE) {
15991554 LLVM_DEBUG(dbgs() << "LICM sinking instruction: " << I << "\n");
16001555 ORE->emit([&]() {
16011556 return OptimizationRemark(DEBUG_TYPE, "InstSunk", &I)
16711626 // If this instruction is only used outside of the loop, then all users are
16721627 // PHI nodes in exit blocks due to LCSSA form. Just RAUW them with clones of
16731628 // the instruction.
1674 // First check if I is worth sinking for all uses. Sink only when it is worth
1675 // across all uses.
16761629 SmallSetVector Users(I.user_begin(), I.user_end());
1677 SmallVector ExitPNs;
16781630 for (auto *UI : Users) {
16791631 auto *User = cast(UI);
16801632
16841636 PHINode *PN = cast(User);
16851637 assert(ExitBlockSet.count(PN->getParent()) &&
16861638 "The LCSSA PHI is not in an exit block!");
1687
1688 if (!worthSinkOrHoistInst(I, PN->getParent(), ORE, BFI)) {
1689 return Changed;
1690 }
1691
1692 ExitPNs.push_back(PN);
1693 }
1694
1695 for (auto *PN: ExitPNs) {
16961639 // The PHI must be trivially replaceable.
16971640 Instruction *New = sinkThroughTriviallyReplaceablePHI(
16981641 PN, &I, LI, SunkCopies, SafetyInfo, CurLoop, MSSAU);
20261969 // Note that proving a load safe to speculate requires proving
20271970 // sufficient alignment at the target location. Proving it guaranteed
20281971 // to execute does as well. Thus we can increase our guaranteed
2029 // alignment as well.
1972 // alignment as well.
20301973 if (!DereferenceableInPH || (InstAlignment > Alignment))
20311974 if (isSafeToExecuteUnconditionally(*Load, DT, CurLoop, SafetyInfo,
20321975 ORE, Preheader->getTerminator())) {
101101 ; CHECK-NEXT: Scalar Evolution Analysis
102102 ; CHECK-NEXT: Loop Pass Manager
103103 ; CHECK-NEXT: Rotate Loops
104 ; CHECK-NEXT: Branch Probability Analysis
105 ; CHECK-NEXT: Block Frequency Analysis
106 ; CHECK-NEXT: Loop Pass Manager
107104 ; CHECK-NEXT: Loop Invariant Code Motion
108 ; CHECK-NEXT: Loop Pass Manager
109105 ; CHECK-NEXT: Unswitch loops
110106 ; CHECK-NEXT: Simplify the CFG
111107 ; CHECK-NEXT: Dominator Tree Construction
157153 ; CHECK-NEXT: Memory Dependence Analysis
158154 ; CHECK-NEXT: Dead Store Elimination
159155 ; CHECK-NEXT: Natural Loop Information
160 ; CHECK-NEXT: Branch Probability Analysis
161 ; CHECK-NEXT: Block Frequency Analysis
162156 ; CHECK-NEXT: Canonicalize natural loops
163157 ; CHECK-NEXT: LCSSA Verifier
164158 ; CHECK-NEXT: Loop-Closed SSA Form Pass
165159 ; CHECK-NEXT: Basic Alias Analysis (stateless AA impl)
166160 ; CHECK-NEXT: Function Alias Analysis Results
167161 ; CHECK-NEXT: Scalar Evolution Analysis
168 ; CHECK-NEXT: Block Frequency Analysis
169162 ; CHECK-NEXT: Loop Pass Manager
170163 ; CHECK-NEXT: Loop Invariant Code Motion
171164 ; CHECK-NEXT: Post-Dominator Tree Construction
252245 ; CHECK-NEXT: Lazy Block Frequency Analysis
253246 ; CHECK-NEXT: Optimization Remark Emitter
254247 ; CHECK-NEXT: Combine redundant instructions
255 ; CHECK-NEXT: Branch Probability Analysis
256 ; CHECK-NEXT: Block Frequency Analysis
257248 ; CHECK-NEXT: Canonicalize natural loops
258249 ; CHECK-NEXT: LCSSA Verifier
259250 ; CHECK-NEXT: Loop-Closed SSA Form Pass
260251 ; CHECK-NEXT: Scalar Evolution Analysis
261 ; CHECK-NEXT: Block Frequency Analysis
262252 ; CHECK-NEXT: Loop Pass Manager
263253 ; CHECK-NEXT: Loop Invariant Code Motion
264254 ; CHECK-NEXT: Lazy Branch Probability Analysis
106106 ; CHECK-NEXT: Scalar Evolution Analysis
107107 ; CHECK-NEXT: Loop Pass Manager
108108 ; CHECK-NEXT: Rotate Loops
109 ; CHECK-NEXT: Branch Probability Analysis
110 ; CHECK-NEXT: Block Frequency Analysis
111 ; CHECK-NEXT: Loop Pass Manager
112109 ; CHECK-NEXT: Loop Invariant Code Motion
113 ; CHECK-NEXT: Loop Pass Manager
114110 ; CHECK-NEXT: Unswitch loops
115111 ; CHECK-NEXT: Simplify the CFG
116112 ; CHECK-NEXT: Dominator Tree Construction
162158 ; CHECK-NEXT: Memory Dependence Analysis
163159 ; CHECK-NEXT: Dead Store Elimination
164160 ; CHECK-NEXT: Natural Loop Information
165 ; CHECK-NEXT: Branch Probability Analysis
166 ; CHECK-NEXT: Block Frequency Analysis
167161 ; CHECK-NEXT: Canonicalize natural loops
168162 ; CHECK-NEXT: LCSSA Verifier
169163 ; CHECK-NEXT: Loop-Closed SSA Form Pass
170164 ; CHECK-NEXT: Basic Alias Analysis (stateless AA impl)
171165 ; CHECK-NEXT: Function Alias Analysis Results
172166 ; CHECK-NEXT: Scalar Evolution Analysis
173 ; CHECK-NEXT: Block Frequency Analysis
174167 ; CHECK-NEXT: Loop Pass Manager
175168 ; CHECK-NEXT: Loop Invariant Code Motion
176169 ; CHECK-NEXT: Post-Dominator Tree Construction
257250 ; CHECK-NEXT: Lazy Block Frequency Analysis
258251 ; CHECK-NEXT: Optimization Remark Emitter
259252 ; CHECK-NEXT: Combine redundant instructions
260 ; CHECK-NEXT: Branch Probability Analysis
261 ; CHECK-NEXT: Block Frequency Analysis
262253 ; CHECK-NEXT: Canonicalize natural loops
263254 ; CHECK-NEXT: LCSSA Verifier
264255 ; CHECK-NEXT: Loop-Closed SSA Form Pass
265256 ; CHECK-NEXT: Scalar Evolution Analysis
266 ; CHECK-NEXT: Block Frequency Analysis
267257 ; CHECK-NEXT: Loop Pass Manager
268258 ; CHECK-NEXT: Loop Invariant Code Motion
269259 ; CHECK-NEXT: Lazy Branch Probability Analysis
8888 ; CHECK-NEXT: Scalar Evolution Analysis
8989 ; CHECK-NEXT: Loop Pass Manager
9090 ; CHECK-NEXT: Rotate Loops
91 ; CHECK-NEXT: Branch Probability Analysis
92 ; CHECK-NEXT: Block Frequency Analysis
93 ; CHECK-NEXT: Loop Pass Manager
9491 ; CHECK-NEXT: Loop Invariant Code Motion
95 ; CHECK-NEXT: Loop Pass Manager
9692 ; CHECK-NEXT: Unswitch loops
9793 ; CHECK-NEXT: Simplify the CFG
9894 ; CHECK-NEXT: Dominator Tree Construction
144140 ; CHECK-NEXT: Memory Dependence Analysis
145141 ; CHECK-NEXT: Dead Store Elimination
146142 ; CHECK-NEXT: Natural Loop Information
147 ; CHECK-NEXT: Branch Probability Analysis
148 ; CHECK-NEXT: Block Frequency Analysis
149143 ; CHECK-NEXT: Canonicalize natural loops
150144 ; CHECK-NEXT: LCSSA Verifier
151145 ; CHECK-NEXT: Loop-Closed SSA Form Pass
152146 ; CHECK-NEXT: Basic Alias Analysis (stateless AA impl)
153147 ; CHECK-NEXT: Function Alias Analysis Results
154148 ; CHECK-NEXT: Scalar Evolution Analysis
155 ; CHECK-NEXT: Block Frequency Analysis
156149 ; CHECK-NEXT: Loop Pass Manager
157150 ; CHECK-NEXT: Loop Invariant Code Motion
158151 ; CHECK-NEXT: Post-Dominator Tree Construction
239232 ; CHECK-NEXT: Lazy Block Frequency Analysis
240233 ; CHECK-NEXT: Optimization Remark Emitter
241234 ; CHECK-NEXT: Combine redundant instructions
242 ; CHECK-NEXT: Branch Probability Analysis
243 ; CHECK-NEXT: Block Frequency Analysis
244 ; CHECK-NEXT: Canonicalize natural loops
245 ; CHECK-NEXT: LCSSA Verifier
246 ; CHECK-NEXT: Loop-Closed SSA Form Pass
247 ; CHECK-NEXT: Scalar Evolution Analysis
248 ; CHECK-NEXT: Block Frequency Analysis
235 ; CHECK-NEXT: Canonicalize natural loops
236 ; CHECK-NEXT: LCSSA Verifier
237 ; CHECK-NEXT: Loop-Closed SSA Form Pass
238 ; CHECK-NEXT: Scalar Evolution Analysis
249239 ; CHECK-NEXT: Loop Pass Manager
250240 ; CHECK-NEXT: Loop Invariant Code Motion
251241 ; CHECK-NEXT: Lazy Branch Probability Analysis
5151 ; CHECK-O2-NEXT: FunctionPass Manager
5252 ; CHECK-O2-NOT: Manager
5353 ; CHECK-O2: Loop Pass Manager
54 ; Requiring block frequency for LICM will place ICM and rotation under separate Loop Pass Manager
54 ; CHECK-O2-NOT: Manager
5555 ; FIXME: We shouldn't be pulling out to simplify-cfg and instcombine and
5656 ; causing new loop pass managers.
5757 ; CHECK-O2: Simplify the CFG
None ; RUN: opt -S -licm -licm -licm-coldness-threshold=0 < %s | FileCheck %s --check-prefix=CHECK-LICM
1 ; RUN: opt -S -licm -licm < %s | FileCheck %s --check-prefix=CHECK-BFI-LICM
0 ; RUN: opt -S -licm < %s | FileCheck %s --check-prefix=CHECK-LICM
21 ; RUN: opt -S -licm < %s | opt -S -loop-sink | FileCheck %s --check-prefix=CHECK-SINK
32 ; RUN: opt -S < %s -passes='require,loop(licm),loop-sink' \
43 ; RUN: | FileCheck %s --check-prefix=CHECK-SINK
5 ; RUN: opt -S -licm -licm-coldness-threshold=0 -enable-mssa-loop-dependency=true -verify-memoryssa < %s | FileCheck %s --check-prefix=CHECK-LICM
6 ; RUN: opt -S -licm -enable-mssa-loop-dependency=true -verify-memoryssa < %s | FileCheck %s --check-prefix=CHECK-BFI-LICM
4 ; RUN: opt -S -licm -enable-mssa-loop-dependency=true -verify-memoryssa < %s | FileCheck %s --check-prefix=CHECK-LICM
75
86 ; Original source code:
97 ; int g;
2927 ; CHECK-LICM: .lr.ph.preheader:
3028 ; CHECK-LICM: load i32, i32* @g
3129 ; CHECK-LICM: br label %.lr.ph
32
33 ; CHECK-BFI-LICM: .lr.ph.preheader:
34 ; CHECK-BFI-LICM-NOT: load i32, i32* @g
35 ; CHECK-BFI-LICM: br label %.lr.ph
3630
3731 .lr.ph:
3832 %.03 = phi i32 [ %8, %.combine ], [ 0, %.lr.ph.preheader ]