LLVM 17.0.0git
MergedLoadStoreMotion.cpp
Go to the documentation of this file.
1//===- MergedLoadStoreMotion.cpp - merge and hoist/sink load/stores -------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9//! \file
10//! This pass performs merges of loads and stores on both sides of a
11// diamond (hammock). It hoists the loads and sinks the stores.
12//
13// The algorithm iteratively hoists two loads to the same address out of a
14// diamond (hammock) and merges them into a single load in the header. Similar
15// it sinks and merges two stores to the tail block (footer). The algorithm
16// iterates over the instructions of one side of the diamond and attempts to
17// find a matching load/store on the other side. New tail/footer block may be
18// insterted if the tail/footer block has more predecessors (not only the two
19// predecessors that are forming the diamond). It hoists / sinks when it thinks
20// it safe to do so. This optimization helps with eg. hiding load latencies,
21// triggering if-conversion, and reducing static code size.
22//
23// NOTE: This code no longer performs load hoisting, it is subsumed by GVNHoist.
24//
25//===----------------------------------------------------------------------===//
26//
27//
28// Example:
29// Diamond shaped code before merge:
30//
31// header:
32// br %cond, label %if.then, label %if.else
33// + +
34// + +
35// + +
36// if.then: if.else:
37// %lt = load %addr_l %le = load %addr_l
38// <use %lt> <use %le>
39// <...> <...>
40// store %st, %addr_s store %se, %addr_s
41// br label %if.end br label %if.end
42// + +
43// + +
44// + +
45// if.end ("footer"):
46// <...>
47//
48// Diamond shaped code after merge:
49//
50// header:
51// %l = load %addr_l
52// br %cond, label %if.then, label %if.else
53// + +
54// + +
55// + +
56// if.then: if.else:
57// <use %l> <use %l>
58// <...> <...>
59// br label %if.end br label %if.end
60// + +
61// + +
62// + +
63// if.end ("footer"):
64// %s.sink = phi [%st, if.then], [%se, if.else]
65// <...>
66// store %s.sink, %addr_s
67// <...>
68//
69//
70//===----------------------- TODO -----------------------------------------===//
71//
72// 1) Generalize to regions other than diamonds
73// 2) Be more aggressive merging memory operations
74// Note that both changes require register pressure control
75//
76//===----------------------------------------------------------------------===//
77
81#include "llvm/IR/IRBuilder.h"
84#include "llvm/Support/Debug.h"
88
89using namespace llvm;
90
91#define DEBUG_TYPE "mldst-motion"
92
93namespace {
94//===----------------------------------------------------------------------===//
95// MergedLoadStoreMotion Pass
96//===----------------------------------------------------------------------===//
98 AliasAnalysis *AA = nullptr;
99
100 // The mergeLoad/Store algorithms could have Size0 * Size1 complexity,
101 // where Size0 and Size1 are the #instructions on the two sides of
102 // the diamond. The constant chosen here is arbitrary. Compiler Time
103 // Control is enforced by the check Size0 * Size1 < MagicCompileTimeControl.
104 const int MagicCompileTimeControl = 250;
105
106 const bool SplitFooterBB;
107public:
108 MergedLoadStoreMotion(bool SplitFooterBB) : SplitFooterBB(SplitFooterBB) {}
109 bool run(Function &F, AliasAnalysis &AA);
110
111private:
112 BasicBlock *getDiamondTail(BasicBlock *BB);
113 bool isDiamondHead(BasicBlock *BB);
114 // Routines for sinking stores
115 StoreInst *canSinkFromBlock(BasicBlock *BB, StoreInst *SI);
116 PHINode *getPHIOperand(BasicBlock *BB, StoreInst *S0, StoreInst *S1);
117 bool isStoreSinkBarrierInRange(const Instruction &Start,
118 const Instruction &End, MemoryLocation Loc);
119 bool canSinkStoresAndGEPs(StoreInst *S0, StoreInst *S1) const;
120 void sinkStoresAndGEPs(BasicBlock *BB, StoreInst *SinkCand,
121 StoreInst *ElseInst);
122 bool mergeStores(BasicBlock *BB);
123};
124} // end anonymous namespace
125
126///
127/// Return tail block of a diamond.
128///
129BasicBlock *MergedLoadStoreMotion::getDiamondTail(BasicBlock *BB) {
130 assert(isDiamondHead(BB) && "Basic block is not head of a diamond");
132}
133
134///
135/// True when BB is the head of a diamond (hammock)
136///
137bool MergedLoadStoreMotion::isDiamondHead(BasicBlock *BB) {
138 if (!BB)
139 return false;
140 auto *BI = dyn_cast<BranchInst>(BB->getTerminator());
141 if (!BI || !BI->isConditional())
142 return false;
143
144 BasicBlock *Succ0 = BI->getSuccessor(0);
145 BasicBlock *Succ1 = BI->getSuccessor(1);
146
147 if (!Succ0->getSinglePredecessor())
148 return false;
149 if (!Succ1->getSinglePredecessor())
150 return false;
151
152 BasicBlock *Succ0Succ = Succ0->getSingleSuccessor();
153 BasicBlock *Succ1Succ = Succ1->getSingleSuccessor();
154 // Ignore triangles.
155 if (!Succ0Succ || !Succ1Succ || Succ0Succ != Succ1Succ)
156 return false;
157 return true;
158}
159
160
161///
162/// True when instruction is a sink barrier for a store
163/// located in Loc
164///
165/// Whenever an instruction could possibly read or modify the
166/// value being stored or protect against the store from
167/// happening it is considered a sink barrier.
168///
169bool MergedLoadStoreMotion::isStoreSinkBarrierInRange(const Instruction &Start,
170 const Instruction &End,
171 MemoryLocation Loc) {
172 for (const Instruction &Inst :
173 make_range(Start.getIterator(), End.getIterator()))
174 if (Inst.mayThrow())
175 return true;
176 return AA->canInstructionRangeModRef(Start, End, Loc, ModRefInfo::ModRef);
177}
178
179///
180/// Check if \p BB contains a store to the same address as \p SI
181///
182/// \return The store in \p when it is safe to sink. Otherwise return Null.
183///
184StoreInst *MergedLoadStoreMotion::canSinkFromBlock(BasicBlock *BB1,
185 StoreInst *Store0) {
186 LLVM_DEBUG(dbgs() << "can Sink? : "; Store0->dump(); dbgs() << "\n");
187 BasicBlock *BB0 = Store0->getParent();
188 for (Instruction &Inst : reverse(*BB1)) {
189 auto *Store1 = dyn_cast<StoreInst>(&Inst);
190 if (!Store1)
191 continue;
192
193 MemoryLocation Loc0 = MemoryLocation::get(Store0);
194 MemoryLocation Loc1 = MemoryLocation::get(Store1);
195
196 if (AA->isMustAlias(Loc0, Loc1) &&
197 !isStoreSinkBarrierInRange(*Store1->getNextNode(), BB1->back(), Loc1) &&
198 !isStoreSinkBarrierInRange(*Store0->getNextNode(), BB0->back(), Loc0) &&
199 Store0->hasSameSpecialState(Store1) &&
201 Store0->getValueOperand()->getType(),
202 Store1->getValueOperand()->getType(),
203 Store0->getModule()->getDataLayout()))
204 return Store1;
205 }
206 return nullptr;
207}
208
209///
210/// Create a PHI node in BB for the operands of S0 and S1
211///
212PHINode *MergedLoadStoreMotion::getPHIOperand(BasicBlock *BB, StoreInst *S0,
213 StoreInst *S1) {
214 // Create a phi if the values mismatch.
215 Value *Opd1 = S0->getValueOperand();
216 Value *Opd2 = S1->getValueOperand();
217 if (Opd1 == Opd2)
218 return nullptr;
219
220 auto *NewPN = PHINode::Create(Opd1->getType(), 2, Opd2->getName() + ".sink",
221 &BB->front());
222 NewPN->applyMergedLocation(S0->getDebugLoc(), S1->getDebugLoc());
223 NewPN->addIncoming(Opd1, S0->getParent());
224 NewPN->addIncoming(Opd2, S1->getParent());
225 return NewPN;
226}
227
228///
229/// Check if 2 stores can be sunk, optionally together with corresponding GEPs.
230///
231bool MergedLoadStoreMotion::canSinkStoresAndGEPs(StoreInst *S0,
232 StoreInst *S1) const {
233 if (S0->getPointerOperand() == S1->getPointerOperand())
234 return true;
235 auto *GEP0 = dyn_cast<GetElementPtrInst>(S0->getPointerOperand());
236 auto *GEP1 = dyn_cast<GetElementPtrInst>(S1->getPointerOperand());
237 return GEP0 && GEP1 && GEP0->isIdenticalTo(GEP1) && GEP0->hasOneUse() &&
238 (GEP0->getParent() == S0->getParent()) && GEP1->hasOneUse() &&
239 (GEP1->getParent() == S1->getParent());
240}
241
242///
243/// Merge two stores to same address and sink into \p BB
244///
245/// Optionally also sinks GEP instruction computing the store address
246///
247void MergedLoadStoreMotion::sinkStoresAndGEPs(BasicBlock *BB, StoreInst *S0,
248 StoreInst *S1) {
249 Value *Ptr0 = S0->getPointerOperand();
250 Value *Ptr1 = S1->getPointerOperand();
251 // Only one definition?
252 LLVM_DEBUG(dbgs() << "Sink Instruction into BB \n"; BB->dump();
253 dbgs() << "Instruction Left\n"; S0->dump(); dbgs() << "\n";
254 dbgs() << "Instruction Right\n"; S1->dump(); dbgs() << "\n");
255 // Hoist the instruction.
257 // Intersect optional metadata.
258 S0->andIRFlags(S1);
261 S0->mergeDIAssignID(S1);
262
263 // Insert bitcast for conflicting typed stores (or just use original value if
264 // same type).
266 auto Cast = Builder.CreateBitOrPointerCast(S0->getValueOperand(),
267 S1->getValueOperand()->getType());
268 S0->setOperand(0, Cast);
269
270 // Create the new store to be inserted at the join point.
271 StoreInst *SNew = cast<StoreInst>(S0->clone());
272 SNew->insertBefore(&*InsertPt);
273 // New PHI operand? Use it.
274 if (PHINode *NewPN = getPHIOperand(BB, S0, S1))
275 SNew->setOperand(0, NewPN);
276 S0->eraseFromParent();
277 S1->eraseFromParent();
278
279 if (Ptr0 != Ptr1) {
280 auto *GEP0 = cast<GetElementPtrInst>(Ptr0);
281 auto *GEP1 = cast<GetElementPtrInst>(Ptr1);
282 Instruction *GEPNew = GEP0->clone();
283 GEPNew->insertBefore(SNew);
284 GEPNew->applyMergedLocation(GEP0->getDebugLoc(), GEP1->getDebugLoc());
285 SNew->setOperand(1, GEPNew);
286 GEP0->replaceAllUsesWith(GEPNew);
287 GEP0->eraseFromParent();
288 GEP1->replaceAllUsesWith(GEPNew);
289 GEP1->eraseFromParent();
290 }
291}
292
293///
294/// True when two stores are equivalent and can sink into the footer
295///
296/// Starting from a diamond head block, iterate over the instructions in one
297/// successor block and try to match a store in the second successor.
298///
299bool MergedLoadStoreMotion::mergeStores(BasicBlock *HeadBB) {
300
301 bool MergedStores = false;
302 BasicBlock *TailBB = getDiamondTail(HeadBB);
303 BasicBlock *SinkBB = TailBB;
304 assert(SinkBB && "Footer of a diamond cannot be empty");
305
306 succ_iterator SI = succ_begin(HeadBB);
307 assert(SI != succ_end(HeadBB) && "Diamond head cannot have zero successors");
308 BasicBlock *Pred0 = *SI;
309 ++SI;
310 assert(SI != succ_end(HeadBB) && "Diamond head cannot have single successor");
311 BasicBlock *Pred1 = *SI;
312 // tail block of a diamond/hammock?
313 if (Pred0 == Pred1)
314 return false; // No.
315 // bail out early if we can not merge into the footer BB
316 if (!SplitFooterBB && TailBB->hasNPredecessorsOrMore(3))
317 return false;
318 // #Instructions in Pred1 for Compile Time Control
319 auto InstsNoDbg = Pred1->instructionsWithoutDebug();
320 int Size1 = std::distance(InstsNoDbg.begin(), InstsNoDbg.end());
321 int NStores = 0;
322
323 for (BasicBlock::reverse_iterator RBI = Pred0->rbegin(), RBE = Pred0->rend();
324 RBI != RBE;) {
325
326 Instruction *I = &*RBI;
327 ++RBI;
328
329 // Don't sink non-simple (atomic, volatile) stores.
330 auto *S0 = dyn_cast<StoreInst>(I);
331 if (!S0 || !S0->isSimple())
332 continue;
333
334 ++NStores;
335 if (NStores * Size1 >= MagicCompileTimeControl)
336 break;
337 if (StoreInst *S1 = canSinkFromBlock(Pred1, S0)) {
338 if (!canSinkStoresAndGEPs(S0, S1))
339 // Don't attempt to sink below stores that had to stick around
340 // But after removal of a store and some of its feeding
341 // instruction search again from the beginning since the iterator
342 // is likely stale at this point.
343 break;
344
345 if (SinkBB == TailBB && TailBB->hasNPredecessorsOrMore(3)) {
346 // We have more than 2 predecessors. Insert a new block
347 // postdominating 2 predecessors we're going to sink from.
348 SinkBB = SplitBlockPredecessors(TailBB, {Pred0, Pred1}, ".sink.split");
349 if (!SinkBB)
350 break;
351 }
352
353 MergedStores = true;
354 sinkStoresAndGEPs(SinkBB, S0, S1);
355 RBI = Pred0->rbegin();
356 RBE = Pred0->rend();
357 LLVM_DEBUG(dbgs() << "Search again\n"; Instruction *I = &*RBI; I->dump());
358 }
359 }
360 return MergedStores;
361}
362
363bool MergedLoadStoreMotion::run(Function &F, AliasAnalysis &AA) {
364 this->AA = &AA;
365
366 bool Changed = false;
367 LLVM_DEBUG(dbgs() << "Instruction Merger\n");
368
369 // Merge unconditional branches, allowing PRE to catch more
370 // optimization opportunities.
371 // This loop doesn't care about newly inserted/split blocks
372 // since they never will be diamond heads.
374 // Hoist equivalent loads and sink stores
375 // outside diamonds when possible
376 if (isDiamondHead(&BB))
377 Changed |= mergeStores(&BB);
378 return Changed;
379}
380
381namespace {
382class MergedLoadStoreMotionLegacyPass : public FunctionPass {
383 const bool SplitFooterBB;
384public:
385 static char ID; // Pass identification, replacement for typeid
386 MergedLoadStoreMotionLegacyPass(bool SplitFooterBB = false)
387 : FunctionPass(ID), SplitFooterBB(SplitFooterBB) {
390 }
391
392 ///
393 /// Run the transformation for each function
394 ///
395 bool runOnFunction(Function &F) override {
396 if (skipFunction(F))
397 return false;
398 MergedLoadStoreMotion Impl(SplitFooterBB);
399 return Impl.run(F, getAnalysis<AAResultsWrapperPass>().getAAResults());
400 }
401
402private:
403 void getAnalysisUsage(AnalysisUsage &AU) const override {
404 if (!SplitFooterBB)
405 AU.setPreservesCFG();
408 }
409};
410
411char MergedLoadStoreMotionLegacyPass::ID = 0;
412} // anonymous namespace
413
414///
415/// createMergedLoadStoreMotionPass - The public interface to this file.
416///
418 return new MergedLoadStoreMotionLegacyPass(SplitFooterBB);
419}
420
421INITIALIZE_PASS_BEGIN(MergedLoadStoreMotionLegacyPass, "mldst-motion",
422 "MergedLoadStoreMotion", false, false)
424INITIALIZE_PASS_END(MergedLoadStoreMotionLegacyPass, "mldst-motion",
425 "MergedLoadStoreMotion", false, false)
426
429 MergedLoadStoreMotion Impl(Options.SplitFooterBB);
430 auto &AA = AM.getResult<AAManager>(F);
431 if (!Impl.run(F, AA))
432 return PreservedAnalyses::all();
433
435 if (!Options.SplitFooterBB)
437 return PA;
438}
439
441 raw_ostream &OS, function_ref<StringRef(StringRef)> MapClassName2PassName) {
443 OS, MapClassName2PassName);
444 OS << '<';
445 OS << (Options.SplitFooterBB ? "" : "no-") << "split-footer-bb";
446 OS << '>';
447}
assume Assume Builder
#define LLVM_DEBUG(X)
Definition: Debug.h:101
bool End
Definition: ELF_riscv.cpp:464
This is the interface for a simple mod/ref and alias analysis over globals.
static LVOptions Options
Definition: LVOptions.cpp:25
#define F(x, y, z)
Definition: MD5.cpp:55
#define I(x, y, z)
Definition: MD5.cpp:58
mldst MergedLoadStoreMotion
mldst motion
This pass performs merges of loads and stores on both sides of a.
#define INITIALIZE_PASS_DEPENDENCY(depName)
Definition: PassSupport.h:55
#define INITIALIZE_PASS_END(passName, arg, name, cfg, analysis)
Definition: PassSupport.h:59
#define INITIALIZE_PASS_BEGIN(passName, arg, name, cfg, analysis)
Definition: PassSupport.h:52
@ SI
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
raw_pwrite_stream & OS
A manager for alias analyses.
A wrapper pass to provide the legacy pass manager access to a suitably prepared AAResults object.
A container for analyses that lazily runs them and caches their results.
Definition: PassManager.h:620
Represent the analysis usage information of a pass.
AnalysisUsage & addRequired()
AnalysisUsage & addPreserved()
Add the specified Pass class to the set of analyses preserved by this pass.
void setPreservesCFG()
This function should be called by the pass, iff they do not:
Definition: Pass.cpp:265
LLVM Basic Block Representation.
Definition: BasicBlock.h:56
const_iterator getFirstInsertionPt() const
Returns an iterator to the first instruction in this block that is suitable for inserting a non-PHI i...
Definition: BasicBlock.cpp:254
reverse_iterator rbegin()
Definition: BasicBlock.h:328
iterator_range< filter_iterator< BasicBlock::const_iterator, std::function< bool(const Instruction &)> > > instructionsWithoutDebug(bool SkipPseudoOp=true) const
Return a const iterator range over the instructions in the block, skipping any debug instructions.
Definition: BasicBlock.cpp:103
const Instruction & front() const
Definition: BasicBlock.h:335
const BasicBlock * getSinglePredecessor() const
Return the predecessor of this block if it has a single predecessor block.
Definition: BasicBlock.cpp:293
InstListType::reverse_iterator reverse_iterator
Definition: BasicBlock.h:89
const BasicBlock * getSingleSuccessor() const
Return the successor of this block if it has a single successor.
Definition: BasicBlock.cpp:323
reverse_iterator rend()
Definition: BasicBlock.h:330
InstListType::iterator iterator
Instruction iterators...
Definition: BasicBlock.h:87
const Instruction * getTerminator() const LLVM_READONLY
Returns the terminator instruction if the block is well formed or null if the block is not well forme...
Definition: BasicBlock.h:127
bool hasNPredecessorsOrMore(unsigned N) const
Return true if this block has N predecessors or more.
Definition: BasicBlock.cpp:319
const Instruction & back() const
Definition: BasicBlock.h:337
Represents analyses that only rely on functions' control flow.
Definition: PassManager.h:113
static bool isBitOrNoopPointerCastable(Type *SrcTy, Type *DestTy, const DataLayout &DL)
Check whether a bitcast, inttoptr, or ptrtoint cast between these types is valid and a no-op.
FunctionPass class - This class is used to implement most global optimizations.
Definition: Pass.h:311
virtual bool runOnFunction(Function &F)=0
runOnFunction - Virtual method overriden by subclasses to do the per-function processing of the pass.
bool skipFunction(const Function &F) const
Optional passes call this function to check whether the pass should be skipped.
Definition: Pass.cpp:174
Legacy wrapper pass to provide the GlobalsAAResult object.
This provides a uniform API for creating instructions and inserting them into a basic block: either a...
Definition: IRBuilder.h:2564
Instruction * clone() const
Create a copy of 'this' instruction that is identical in all ways except the following:
void mergeDIAssignID(ArrayRef< const Instruction * > SourceInstructions)
Merge the DIAssignID metadata from this instruction and those attached to instructions in SourceInstr...
Definition: DebugInfo.cpp:875
void insertBefore(Instruction *InsertPos)
Insert an unlinked instruction into a basic block immediately before the specified instruction.
Definition: Instruction.cpp:88
const DebugLoc & getDebugLoc() const
Return the debug location for this node as a DebugLoc.
Definition: Instruction.h:365
const Module * getModule() const
Return the module owning the function this instruction belongs to or nullptr it the function does not...
Definition: Instruction.cpp:70
void andIRFlags(const Value *V)
Logical 'and' of any supported wrapping, exact, and fast-math flags of V and this instruction.
const BasicBlock * getParent() const
Definition: Instruction.h:90
BasicBlock * getSuccessor(unsigned Idx) const LLVM_READONLY
Return the specified successor. This instruction must be a terminator.
bool hasSameSpecialState(const Instruction *I2, bool IgnoreAlignment=false) const LLVM_READONLY
This function determines if the speficied instruction has the same "special" characteristics as the c...
SymbolTableList< Instruction >::iterator eraseFromParent()
This method unlinks 'this' from the containing basic block and deletes it.
Definition: Instruction.cpp:82
void applyMergedLocation(DILocation *LocA, DILocation *LocB)
Merge 2 debug locations and apply it to the Instruction.
Definition: DebugInfo.cpp:871
void dropUnknownNonDebugMetadata(ArrayRef< unsigned > KnownIDs)
Drop all unknown metadata except for debug locations.
Definition: Metadata.cpp:1467
Representation for a specific memory location.
static MemoryLocation get(const LoadInst *LI)
Return a location with information about the memory reference by the given instruction.
void printPipeline(raw_ostream &OS, function_ref< StringRef(StringRef)> MapClassName2PassName)
const DataLayout & getDataLayout() const
Get the data layout for the module's target platform.
Definition: Module.cpp:398
static PHINode * Create(Type *Ty, unsigned NumReservedValues, const Twine &NameStr="", Instruction *InsertBefore=nullptr)
Constructors - NumReservedValues is a hint for the number of incoming edges that this phi node will h...
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
virtual void getAnalysisUsage(AnalysisUsage &) const
getAnalysisUsage - This function should be overriden by passes that need analysis information to do t...
Definition: Pass.cpp:98
A set of analyses that are preserved following a run of a transformation pass.
Definition: PassManager.h:152
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
Definition: PassManager.h:158
void preserveSet()
Mark an analysis set as preserved.
Definition: PassManager.h:188
An instruction for storing to memory.
Definition: Instructions.h:301
bool isSimple() const
Definition: Instructions.h:382
Value * getValueOperand()
Definition: Instructions.h:390
Value * getPointerOperand()
Definition: Instructions.h:393
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:50
void setOperand(unsigned i, Value *Val)
Definition: User.h:174
LLVM Value Representation.
Definition: Value.h:74
Type * getType() const
All values are typed, get the type of this value.
Definition: Value.h:255
StringRef getName() const
Return a constant reference to the value's name.
Definition: Value.cpp:309
void dump() const
Support for debugging, callable in GDB: V->dump()
Definition: AsmWriter.cpp:4938
An efficient, type-erasing, non-owning reference to a callable.
NodeTy * getNextNode()
Get the next node, or nullptr for the list tail.
Definition: ilist_node.h:289
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:52
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
Definition: CallingConv.h:24
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
Interval::succ_iterator succ_end(Interval *I)
Definition: Interval.h:102
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.
Interval::succ_iterator succ_begin(Interval *I)
succ_begin/succ_end - define methods so that Intervals may be used just like BasicBlocks can with the...
Definition: Interval.h:99
iterator_range< early_inc_iterator_impl< detail::IterOfRange< RangeT > > > make_early_inc_range(RangeT &&Range)
Make a range that does early increment to allow mutation of the underlying range without disrupting i...
Definition: STLExtras.h:748
auto reverse(ContainerTy &&C)
Definition: STLExtras.h:511
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
Definition: Debug.cpp:163
BasicBlock * SplitBlockPredecessors(BasicBlock *BB, ArrayRef< BasicBlock * > Preds, const char *Suffix, DominatorTree *DT, LoopInfo *LI=nullptr, MemorySSAUpdater *MSSAU=nullptr, bool PreserveLCSSA=false)
This method introduces at least one new basic block into the function and moves some of the predecess...
void initializeMergedLoadStoreMotionLegacyPassPass(PassRegistry &)
FunctionPass * createMergedLoadStoreMotionPass(bool SplitFooterBB=false)
createMergedLoadStoreMotionPass - The public interface to this file.
A CRTP mix-in to automatically provide informational APIs needed for passes.
Definition: PassManager.h:371