LLVM 24.0.0git
LoopVersioning.cpp
Go to the documentation of this file.
1//===- LoopVersioning.cpp - Utility to version a loop ---------------------===//
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// This file defines a utility class to perform loop versioning. The versioned
10// loop speculates that otherwise may-aliasing memory accesses don't overlap and
11// emits checks to prove this.
12//
13//===----------------------------------------------------------------------===//
14
16#include "llvm/ADT/ArrayRef.h"
26#include "llvm/IR/Dominators.h"
27#include "llvm/IR/MDBuilder.h"
28#include "llvm/IR/PassManager.h"
35#include <memory>
36
37using namespace llvm;
38
39#define DEBUG_TYPE "loop-versioning"
40
41static cl::opt<bool>
42 AnnotateNoAlias("loop-version-annotate-no-alias", cl::init(true),
44 cl::desc("Add no-alias annotation for instructions that "
45 "are disambiguated by memchecks"));
46
49 LoopInfo *LI, DominatorTree *DT,
51 : VersionedLoop(L), AliasChecks(Checks), Preds(LAI.getPSE().getPredicate()),
52 LAI(LAI), LI(LI), DT(DT), SE(SE), MSSAU(MSSAU) {}
53
55 const SmallVectorImpl<Instruction *> &DefsUsedOutside) {
56 assert(VersionedLoop->getUniqueExitBlock() && "No single exit block");
57 assert(VersionedLoop->isLoopSimplifyForm() &&
58 "Loop is not in loop-simplify form");
59 // Assert that the loop is in LCSSA form. This is a precondition of
60 // versioning.
61 assert(VersionedLoop->isRecursivelyLCSSAForm(*DT, *LI) &&
62 "Loop is not in LCSSA form");
63
64 Value *MemRuntimeCheck;
65 Value *SCEVRuntimeCheck;
66 Value *RuntimeCheck = nullptr;
67
68 // Add the memcheck in the original preheader (this is empty initially).
69 BasicBlock *RuntimeCheckBB = VersionedLoop->getLoopPreheader();
70 const auto &RtPtrChecking = *LAI.getRuntimePointerChecking();
71
72 SCEVExpander Exp2(*RtPtrChecking.getSE(), "induction");
73 MemRuntimeCheck = addRuntimeChecks(RuntimeCheckBB->getTerminator(),
74 VersionedLoop, AliasChecks, Exp2);
75
76 SCEVExpander Exp(*SE, "scev.check");
77 SCEVRuntimeCheck =
78 Exp.expandCodeForPredicate(&Preds, RuntimeCheckBB->getTerminator());
79
81 *RuntimeCheckBB->getModule(),
82 InstSimplifyFolder(RuntimeCheckBB->getDataLayout()));
83 if (MemRuntimeCheck && SCEVRuntimeCheck) {
84 Builder.SetInsertPoint(RuntimeCheckBB->getTerminator());
85 RuntimeCheck =
86 Builder.CreateOr(MemRuntimeCheck, SCEVRuntimeCheck, "lver.safe");
87 } else
88 RuntimeCheck = MemRuntimeCheck ? MemRuntimeCheck : SCEVRuntimeCheck;
89
90 Exp.eraseDeadInstructions(SCEVRuntimeCheck);
91
92 assert(RuntimeCheck && "called even though we don't need "
93 "any runtime checks");
94
95 // Rename the block to make the IR more readable.
96 RuntimeCheckBB->setName(VersionedLoop->getHeader()->getName() +
97 ".lver.check");
98
99 // Create empty preheader for the loop (and after cloning for the
100 // non-versioned loop).
101 BasicBlock *PH =
102 SplitBlock(RuntimeCheckBB, RuntimeCheckBB->getTerminator(), DT, LI, MSSAU,
103 VersionedLoop->getHeader()->getName() + ".ph");
104
105 // Clone the loop including the preheader.
106 //
107 // FIXME: This does not currently preserve SimplifyLoop because the exit
108 // block is a join between the two loops.
109 SmallVector<BasicBlock *, 8> NonVersionedLoopBlocks;
110 NonVersionedLoop =
111 cloneLoopWithPreheader(PH, RuntimeCheckBB, VersionedLoop, VMap,
112 ".lver.orig", LI, DT, NonVersionedLoopBlocks);
113 remapInstructionsInBlocks(NonVersionedLoopBlocks, VMap,
114 LAI.getDepChecker().getAC());
115
116 // Insert the conditional branch based on the result of the memchecks.
117 Instruction *OrigTerm = RuntimeCheckBB->getTerminator();
118 Builder.SetInsertPoint(OrigTerm);
119 auto *BI =
120 Builder.CreateCondBr(RuntimeCheck, NonVersionedLoop->getLoopPreheader(),
121 VersionedLoop->getLoopPreheader());
122 // We don't know what the probability of executing the versioned vs the
123 // unversioned variants is.
125 OrigTerm->eraseFromParent();
126
127 // The loops merge in the original exit block. This is now dominated by the
128 // memchecking block.
129 DT->changeImmediateDominator(VersionedLoop->getExitBlock(), RuntimeCheckBB);
130
131 // Update MemorySSA, if it is needed.
132 if (MSSAU) {
133 LoopBlocksRPO LoopRPOT(VersionedLoop);
134 LoopRPOT.perform(LI);
135 MSSAU->updateForClonedLoop(LoopRPOT, /*ExitBlocks=*/{}, VMap);
136
137 // Update MemorySSA for new CFG edges reaching the new NonVersionedLoop as
138 // well as exiting it.
140 Updates.push_back({cfg::UpdateKind::Insert, RuntimeCheckBB,
141 NonVersionedLoop->getLoopPreheader()});
143 LI->getExitEdges(*NonVersionedLoop, ExitEdges);
144 for (auto [Exiting, Exit] : ExitEdges)
145 Updates.push_back({cfg::UpdateKind::Insert, Exiting, Exit});
146 MSSAU->applyInsertUpdates(Updates, *DT);
147 }
148
149 // Adds the necessary PHI nodes for the versioned loops based on the
150 // loop-defined values used outside of the loop.
151 addPHINodes(DefsUsedOutside);
152 formDedicatedExitBlocks(NonVersionedLoop, DT, LI, MSSAU, true);
153 formDedicatedExitBlocks(VersionedLoop, DT, LI, MSSAU, true);
154 assert(NonVersionedLoop->isLoopSimplifyForm() &&
155 VersionedLoop->isLoopSimplifyForm() &&
156 "The versioned loops should be in simplify form.");
157}
158
159void LoopVersioning::addPHINodes(
160 const SmallVectorImpl<Instruction *> &DefsUsedOutside) {
161 BasicBlock *PHIBlock = VersionedLoop->getExitBlock();
162 assert(PHIBlock && "No single successor to loop exit block");
163 PHINode *PN;
164
165 // First add a single-operand PHI for each DefsUsedOutside if one does not
166 // exists yet.
167 for (auto *Inst : DefsUsedOutside) {
168 // See if we have a single-operand PHI with the value defined by the
169 // original loop.
170 for (auto I = PHIBlock->begin(); (PN = dyn_cast<PHINode>(I)); ++I) {
171 if (PN->getIncomingValue(0) == Inst) {
172 SE->forgetLcssaPhiWithNewPredecessor(VersionedLoop, PN);
173 break;
174 }
175 }
176 // If not create it.
177 if (!PN) {
178 PN = PHINode::Create(Inst->getType(), 2, Inst->getName() + ".lver");
179 PN->insertBefore(PHIBlock->begin());
180 SmallVector<User*, 8> UsersToUpdate;
181 for (Instruction *U : Inst->users())
182 if (!VersionedLoop->contains(U->getParent()))
183 UsersToUpdate.push_back(U);
184 for (User *U : UsersToUpdate)
185 U->replaceUsesOfWith(Inst, PN);
186 PN->addIncoming(Inst, VersionedLoop->getExitingBlock());
187 }
188 }
189
190 // Then for each PHI add the operand for the edge from the cloned loop.
191 for (auto I = PHIBlock->begin(); (PN = dyn_cast<PHINode>(I)); ++I) {
192 assert(PN->getNumOperands() == 1 &&
193 "Exit block should only have on predecessor");
194
195 // If the definition was cloned used that otherwise use the same value.
196 Value *ClonedValue = PN->getIncomingValue(0);
197 auto Mapped = VMap.find(ClonedValue);
198 if (Mapped != VMap.end())
199 ClonedValue = Mapped->second;
200
201 PN->addIncoming(ClonedValue, NonVersionedLoop->getExitingBlock());
202 }
203}
204
206 // We need to turn the no-alias relation between pointer checking groups into
207 // no-aliasing annotations between instructions.
208 //
209 // We accomplish this by mapping each pointer checking group (a set of
210 // pointers memchecked together) to an alias scope and then also mapping each
211 // group to the list of scopes it can't alias.
212
213 const RuntimePointerChecking *RtPtrChecking = LAI.getRuntimePointerChecking();
214 LLVMContext &Context = VersionedLoop->getHeader()->getContext();
215
216 // First allocate an aliasing scope for each pointer checking group.
217 //
218 // While traversing through the checking groups in the loop, also create a
219 // reverse map from pointers to the pointer checking group they were assigned
220 // to.
221 MDBuilder MDB(Context);
222 MDNode *Domain = MDB.createAnonymousAliasScopeDomain("LVerDomain");
223
224 for (const auto &Group : RtPtrChecking->CheckingGroups) {
225 GroupToScope[&Group] = MDB.createAnonymousAliasScope(Domain);
226
227 for (unsigned PtrIdx : Group.Members)
228 PtrToGroup[RtPtrChecking->getPointerInfo(PtrIdx).PointerValue] = &Group;
229 }
230
231 // Go through the checks and for each pointer group, collect the scopes for
232 // each non-aliasing pointer group.
234 GroupToNonAliasingScopes;
235
236 for (const auto &Check : AliasChecks)
237 GroupToNonAliasingScopes[Check.first].push_back(GroupToScope[Check.second]);
238
239 // Finally, transform the above to actually map to scope list which is what
240 // the metadata uses.
241
242 for (const auto &Pair : GroupToNonAliasingScopes)
243 GroupToNonAliasingScopeList[Pair.first] = MDNode::get(Context, Pair.second);
244}
245
247 if (!AnnotateNoAlias)
248 return;
249
250 // First prepare the maps.
252
253 // Add the scope and no-alias metadata to the instructions.
254 for (Instruction *I : LAI.getDepChecker().getMemoryInstructions()) {
256 }
257}
258
259std::pair<MDNode *, MDNode *>
261 if (!AnnotateNoAlias)
262 return {nullptr, nullptr};
263
264 LLVMContext &Context = VersionedLoop->getHeader()->getContext();
265 const Value *Ptr = isa<LoadInst>(OrigInst)
266 ? cast<LoadInst>(OrigInst)->getPointerOperand()
267 : cast<StoreInst>(OrigInst)->getPointerOperand();
268
269 MDNode *AliasScope = nullptr;
270 MDNode *NoAlias = nullptr;
271 // Find the group for the pointer and then add the scope metadata.
272 auto Group = PtrToGroup.find(Ptr);
273 if (Group != PtrToGroup.end()) {
274 AliasScope = MDNode::concatenate(
275 OrigInst->getMetadata(LLVMContext::MD_alias_scope),
276 MDNode::get(Context, GroupToScope.lookup(Group->second)));
277
278 // Add the no-alias metadata.
279 auto NonAliasingScopeList = GroupToNonAliasingScopeList.find(Group->second);
280 if (NonAliasingScopeList != GroupToNonAliasingScopeList.end())
281 NoAlias =
282 MDNode::concatenate(OrigInst->getMetadata(LLVMContext::MD_noalias),
283 NonAliasingScopeList->second);
284 }
285 return {AliasScope, NoAlias};
286}
287
289 const Instruction *OrigInst) {
290 const auto &[AliasScopeMD, NoAliasMD] = getNoAliasMetadataFor(OrigInst);
291 if (AliasScopeMD)
292 VersionedInst->setMetadata(LLVMContext::MD_alias_scope, AliasScopeMD);
293
294 if (NoAliasMD)
295 VersionedInst->setMetadata(LLVMContext::MD_noalias, NoAliasMD);
296}
297
298namespace {
300 ScalarEvolution *SE, MemorySSAUpdater *MSSAU) {
301 // Build up a worklist of inner-loops to version. This is necessary as the
302 // act of versioning a loop creates new loops and can invalidate iterators
303 // across the loops.
304 SmallVector<Loop *, 8> Worklist;
305
306 for (Loop *TopLevelLoop : *LI)
307 for (Loop *L : depth_first(TopLevelLoop))
308 // We only handle inner-most loops.
309 if (L->isInnermost())
310 Worklist.push_back(L);
311
312 // Now walk the identified inner loops.
313 bool Changed = false;
314 for (Loop *L : Worklist) {
315 if (!L->isLoopSimplifyForm() || !L->isRotatedForm() ||
316 !L->getExitingBlock())
317 continue;
318 const LoopAccessInfo &LAI = LAIs.getInfo(*L);
319 if (!LAI.hasConvergentOp() &&
321 !LAI.getPSE().getPredicate().isAlwaysTrue())) {
322 // Forming LCSSA is a precondition of versioning.
323 if (!L->isRecursivelyLCSSAForm(*DT, *LI))
324 formLCSSARecursively(*L, *DT, LI, SE);
325
327 LI, DT, SE, MSSAU);
328 LVer.versionLoop();
329 LVer.annotateLoopWithNoAlias();
330 Changed = true;
331 LAIs.clear();
332 }
333 }
334
335 return Changed;
336}
337}
338
341 auto &SE = AM.getResult<ScalarEvolutionAnalysis>(F);
342 auto &LI = AM.getResult<LoopAnalysis>(F);
344 auto &DT = AM.getResult<DominatorTreeAnalysis>(F);
345
346 // Keep MemorySSA up to date if it is available.
347 auto *MSSAAnalysis = AM.getCachedResult<MemorySSAAnalysis>(F);
348 std::unique_ptr<MemorySSAUpdater> MSSAU;
349 if (MSSAAnalysis)
350 MSSAU = std::make_unique<MemorySSAUpdater>(&MSSAAnalysis->getMSSA());
351
352 if (!runImpl(&LI, LAIs, &DT, &SE, MSSAU.get()))
353 return PreservedAnalyses::all();
354
355 if (MSSAAnalysis && VerifyMemorySSA)
356 MSSAAnalysis->getMSSA().verifyMemorySSA();
357
361 if (MSSAAnalysis)
363 return PA;
364}
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static bool runImpl(MachineFunction &MF)
Definition CFIFixup.cpp:304
#define DEBUG_TYPE
This header defines various interfaces for pass management in LLVM.
static cl::opt< bool > AnnotateNoAlias("loop-version-annotate-no-alias", cl::init(true), cl::Hidden, cl::desc("Add no-alias annotation for instructions that " "are disambiguated by memchecks"))
#define F(x, y, z)
Definition MD5.cpp:54
#define I(x, y, z)
Definition MD5.cpp:57
This file exposes an interface to building/using memory SSA to walk memory instructions using a use/d...
This file contains the declarations for profiling metadata utility functions.
PassT::Result * getCachedResult(IRUnitT &IR) const
Get the cached result of an analysis pass for a given IR unit.
PassT::Result & getResult(IRUnitT &IR, ExtraArgTs... ExtraArgs)
Get the result of an analysis pass for a given IR unit.
Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition ArrayRef.h:40
LLVM Basic Block Representation.
Definition BasicBlock.h:61
iterator begin()
Instruction iterator methods.
Definition BasicBlock.h:439
LLVM_ABI const DataLayout & getDataLayout() const
Get the data layout of the module this basic block belongs to.
const Instruction * getTerminator() const LLVM_READONLY
Returns the terminator instruction; assumes that the block is well-formed.
Definition BasicBlock.h:236
LLVM_ABI const Module * getModule() const
Return the module owning the function this basic block belongs to, or nullptr if the function does no...
Analysis pass which computes a DominatorTree.
Definition Dominators.h:241
Concrete subclass of DominatorTreeBase that is used to compute a normal dominator tree.
Definition Dominators.h:122
This provides a uniform API for creating instructions and inserting them into a basic block: either a...
Definition IRBuilder.h:2990
InstSimplifyFolder - Use InstructionSimplify to fold operations to existing values.
LLVM_ABI void insertBefore(InstListType::iterator InsertPos)
Insert an unlinked instruction into a basic block immediately before the specified position.
LLVM_ABI InstListType::iterator eraseFromParent()
This method unlinks 'this' from the containing basic block and deletes it.
MDNode * getMetadata(unsigned KindID) const
Get the metadata of given kind attached to this Instruction.
LLVM_ABI void setMetadata(unsigned KindID, MDNode *Node)
Set the metadata of the specified kind to the specified node.
This is an important class for using LLVM in a threaded context.
Definition LLVMContext.h:76
This analysis provides dependence information for the memory accesses of a loop.
LLVM_ABI const LoopAccessInfo & getInfo(Loop &L, bool AllowPartial=false)
Drive the analysis of memory accesses in the loop.
const RuntimePointerChecking * getRuntimePointerChecking() const
unsigned getNumRuntimePointerChecks() const
Number of memchecks required to prove independence of otherwise may-alias pointers.
const PredicatedScalarEvolution & getPSE() const
Used to add runtime SCEV checks.
bool hasConvergentOp() const
Return true if there is a convergent operation in the loop.
Analysis pass that exposes the LoopInfo for a function.
Definition LoopInfo.h:598
BlockT * getExitBlock() const
If getExitBlocks would return exactly one block, return that block.
Wrapper class to LoopBlocksDFS that provides a standard begin()/end() interface for the DFS reverse p...
void perform(const LoopInfo *LI)
Traverse the loop blocks and store the DFS result.
LLVM_ABI PreservedAnalyses run(Function &F, FunctionAnalysisManager &FAM)
This class emits a version of the loop where run-time checks ensure that may-alias pointers can't ove...
LLVM_ABI void annotateLoopWithNoAlias()
Annotate memory instructions in the versioned loop with no-alias metadata based on the memchecks issu...
LLVM_ABI void prepareNoAliasMetadata()
Set up the aliasing scopes based on the memchecks.
LLVM_ABI void annotateInstWithNoAlias(Instruction *VersionedInst, const Instruction *OrigInst)
Add the noalias annotations to VersionedInst.
void versionLoop()
Performs the CFG manipulation part of versioning the loop including the DominatorTree,...
LLVM_ABI std::pair< MDNode *, MDNode * > getNoAliasMetadataFor(const Instruction *OrigInst) const
Returns a pair containing the alias_scope and noalias metadata nodes for OrigInst,...
LLVM_ABI LoopVersioning(const LoopAccessInfo &LAI, ArrayRef< RuntimePointerCheck > Checks, Loop *L, LoopInfo *LI, DominatorTree *DT, ScalarEvolution *SE, MemorySSAUpdater *MSSAU=nullptr)
Expects LoopAccessInfo, Loop, LoopInfo, DominatorTree as input.
Represents a single loop in the control flow graph.
Definition LoopInfo.h:40
MDNode * createAnonymousAliasScope(MDNode *Domain, StringRef Name=StringRef())
Return metadata appropriate for an alias scope root node.
Definition MDBuilder.h:195
LLVM_ABI MDNode * createAnonymousAliasScopeDomain(StringRef Description=StringRef(), bool DisjointScopes=false)
Return metadata appropriate for an alias scope domain node, described by Description,...
Metadata node.
Definition Metadata.h:1087
static LLVM_ABI MDNode * concatenate(MDNode *A, MDNode *B)
Methods for metadata merging.
static MDTuple * get(LLVMContext &Context, ArrayRef< Metadata * > MDs)
Definition Metadata.h:1588
An analysis that produces MemorySSA for a function.
Definition MemorySSA.h:930
void addIncoming(Value *V, BasicBlock *BB)
Add an incoming value to the end of the PHI list.
Value * getIncomingValue(unsigned i) const
Return incoming value number x.
static PHINode * Create(Type *Ty, unsigned NumReservedValues, const Twine &NameStr="", InsertPosition InsertBefore=nullptr)
Constructors - NumReservedValues is a hint for the number of incoming edges that this phi node will h...
LLVM_ABI const SCEVPredicate & getPredicate() const
A set of analyses that are preserved following a run of a transformation pass.
Definition Analysis.h:112
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
Definition Analysis.h:118
PreservedAnalyses & preserve()
Mark an analysis as preserved.
Definition Analysis.h:132
Holds information about the memory runtime legality checks to verify that a group of pointers do not ...
SmallVector< RuntimeCheckingPtrGroup, 2 > CheckingGroups
Holds a partitioning of pointers into "check groups".
const SmallVectorImpl< RuntimePointerCheck > & getChecks() const
Returns the checks that generateChecks created.
const PointerInfo & getPointerInfo(unsigned PtrIdx) const
Return PointerInfo for pointer at index PtrIdx.
This class uses information about analyze scalars to rewrite expressions in canonical form.
virtual bool isAlwaysTrue() const =0
Returns true if the predicate is always true.
Analysis pass that exposes the ScalarEvolution for a function.
The main scalar evolution driver.
LLVM_ABI void forgetLcssaPhiWithNewPredecessor(Loop *L, PHINode *V)
Forget LCSSA phi node V of loop L to which a new predecessor was added, such that it may no longer be...
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
void push_back(const T &Elt)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
unsigned getNumOperands() const
Definition User.h:229
LLVM Value Representation.
Definition Value.h:75
LLVM_ABI void setName(const Twine &Name)
Change the name of the value.
Definition Value.cpp:389
LLVM_ABI StringRef getName() const
Return a constant reference to the value's name.
Definition Value.cpp:314
initializer< Ty > init(const Ty &Val)
This is an optimization pass for GlobalISel generic memory operations.
LLVM_ABI Value * addRuntimeChecks(Instruction *Loc, Loop *TheLoop, const SmallVectorImpl< RuntimePointerCheck > &PointerChecks, SCEVExpander &Expander, bool HoistRuntimeChecks=false)
Add code that checks at runtime if the accessed arrays in PointerChecks overlap.
LLVM_ABI void setExplicitlyUnknownBranchWeightsIfProfiled(Instruction &I, StringRef PassName, const Function *F=nullptr)
Like setExplicitlyUnknownBranchWeights(...), but only sets unknown branch weights in the new instruct...
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
Definition Casting.h:643
LLVM_ABI bool formLCSSARecursively(Loop &L, const DominatorTree &DT, const LoopInfo *LI, ScalarEvolution *SE)
Put a loop nest into LCSSA form.
Definition LCSSA.cpp:469
LLVM_ABI void remapInstructionsInBlocks(ArrayRef< BasicBlock * > Blocks, ValueToValueMapTy &VMap, AssumptionCache *AC=nullptr)
Remaps instructions in Blocks using the mapping in VMap.
RelativeUniformCounterPtr ValuesPtrExpr VTableAddr Value
Definition InstrProf.h:143
LLVM_ABI Loop * cloneLoopWithPreheader(BasicBlock *Before, BasicBlock *LoopDomBB, Loop *OrigLoop, ValueToValueMapTy &VMap, const Twine &NameSuffix, LoopInfo *LI, DominatorTree *DT, SmallVectorImpl< BasicBlock * > &Blocks)
Clones a loop OrigLoop.
LLVM_ABI bool VerifyMemorySSA
Enables verification of MemorySSA.
Definition MemorySSA.cpp:74
class LLVM_GSL_OWNER SmallVector
Forward declaration of SmallVector so that calculateSmallVectorDefaultInlinedElements can reference s...
bool isa(const From &Val)
isa<X> - Return true if the parameter to the template is an instance of one of the template type argu...
Definition Casting.h:547
LLVM_ABI BasicBlock * SplitBlock(BasicBlock *Old, BasicBlock::iterator SplitPt, DominatorTree *DT, LoopInfo *LI=nullptr, MemorySSAUpdater *MSSAU=nullptr, const Twine &BBName="")
Split the specified block at the specified instruction.
LLVM_ABI bool formDedicatedExitBlocks(Loop *L, DominatorTree *DT, LoopInfo *LI, MemorySSAUpdater *MSSAU, bool PreserveLCSSA)
Ensure that all exit blocks of the loop are dedicated exits.
Definition LoopUtils.cpp:59
decltype(auto) cast(const From &Val)
cast<X> - Return the argument parameter cast to the specified type.
Definition Casting.h:559
iterator_range< df_iterator< T > > depth_first(const T &G)
AnalysisManager< Function > FunctionAnalysisManager
Convenience typedef for the Function analysis manager.
TrackingVH< Value > PointerValue
Holds the pointer value that we need to check.