LLVM  14.0.0git
GCRootLowering.cpp
Go to the documentation of this file.
1 //===-- GCRootLowering.cpp - Garbage collection infrastructure ------------===//
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 implements the lowering for the gc.root mechanism.
10 //
11 //===----------------------------------------------------------------------===//
12 
18 #include "llvm/CodeGen/Passes.h"
23 #include "llvm/IR/Dominators.h"
24 #include "llvm/IR/IntrinsicInst.h"
25 #include "llvm/IR/Module.h"
26 #include "llvm/InitializePasses.h"
27 #include "llvm/Support/Debug.h"
30 
31 using namespace llvm;
32 
33 namespace {
34 
35 /// LowerIntrinsics - This pass rewrites calls to the llvm.gcread or
36 /// llvm.gcwrite intrinsics, replacing them with simple loads and stores as
37 /// directed by the GCStrategy. It also performs automatic root initialization
38 /// and custom intrinsic lowering.
39 class LowerIntrinsics : public FunctionPass {
40  bool DoLowering(Function &F, GCStrategy &S);
41 
42 public:
43  static char ID;
44 
45  LowerIntrinsics();
46  StringRef getPassName() const override;
47  void getAnalysisUsage(AnalysisUsage &AU) const override;
48 
49  bool doInitialization(Module &M) override;
50  bool runOnFunction(Function &F) override;
51 };
52 
53 /// GCMachineCodeAnalysis - This is a target-independent pass over the machine
54 /// function representation to identify safe points for the garbage collector
55 /// in the machine code. It inserts labels at safe points and populates a
56 /// GCMetadata record for each function.
57 class GCMachineCodeAnalysis : public MachineFunctionPass {
58  GCFunctionInfo *FI;
59  const TargetInstrInfo *TII;
60 
61  void FindSafePoints(MachineFunction &MF);
62  void VisitCallPoint(MachineBasicBlock::iterator CI);
64  const DebugLoc &DL) const;
65 
66  void FindStackOffsets(MachineFunction &MF);
67 
68 public:
69  static char ID;
70 
71  GCMachineCodeAnalysis();
72  void getAnalysisUsage(AnalysisUsage &AU) const override;
73 
74  bool runOnMachineFunction(MachineFunction &MF) override;
75 };
76 }
77 
78 // -----------------------------------------------------------------------------
79 
80 INITIALIZE_PASS_BEGIN(LowerIntrinsics, "gc-lowering", "GC Lowering", false,
81  false)
83 INITIALIZE_PASS_END(LowerIntrinsics, "gc-lowering", "GC Lowering", false, false)
84 
85 FunctionPass *llvm::createGCLoweringPass() { return new LowerIntrinsics(); }
86 
87 char LowerIntrinsics::ID = 0;
89 
90 LowerIntrinsics::LowerIntrinsics() : FunctionPass(ID) {
92 }
93 
94 StringRef LowerIntrinsics::getPassName() const {
95  return "Lower Garbage Collection Instructions";
96 }
97 
98 void LowerIntrinsics::getAnalysisUsage(AnalysisUsage &AU) const {
99  FunctionPass::getAnalysisUsage(AU);
102 }
103 
104 /// doInitialization - If this module uses the GC intrinsics, find them now.
105 bool LowerIntrinsics::doInitialization(Module &M) {
106  GCModuleInfo *MI = getAnalysisIfAvailable<GCModuleInfo>();
107  assert(MI && "LowerIntrinsics didn't require GCModuleInfo!?");
108  for (Function &F : M)
109  if (!F.isDeclaration() && F.hasGC())
110  MI->getFunctionInfo(F); // Instantiate the GC strategy.
111 
112  return false;
113 }
114 
115 /// CouldBecomeSafePoint - Predicate to conservatively determine whether the
116 /// instruction could introduce a safe point.
118  // The natural definition of instructions which could introduce safe points
119  // are:
120  //
121  // - call, invoke (AfterCall, BeforeCall)
122  // - phis (Loops)
123  // - invoke, ret, unwind (Exit)
124  //
125  // However, instructions as seemingly inoccuous as arithmetic can become
126  // libcalls upon lowering (e.g., div i64 on a 32-bit platform), so instead
127  // it is necessary to take a conservative approach.
128 
129  if (isa<AllocaInst>(I) || isa<GetElementPtrInst>(I) || isa<StoreInst>(I) ||
130  isa<LoadInst>(I))
131  return false;
132 
133  // llvm.gcroot is safe because it doesn't do anything at runtime.
134  if (CallInst *CI = dyn_cast<CallInst>(I))
135  if (Function *F = CI->getCalledFunction())
136  if (Intrinsic::ID IID = F->getIntrinsicID())
137  if (IID == Intrinsic::gcroot)
138  return false;
139 
140  return true;
141 }
142 
144  // Scroll past alloca instructions.
145  BasicBlock::iterator IP = F.getEntryBlock().begin();
146  while (isa<AllocaInst>(IP))
147  ++IP;
148 
149  // Search for initializers in the initial BB.
150  SmallPtrSet<AllocaInst *, 16> InitedRoots;
151  for (; !CouldBecomeSafePoint(&*IP); ++IP)
152  if (StoreInst *SI = dyn_cast<StoreInst>(IP))
153  if (AllocaInst *AI =
154  dyn_cast<AllocaInst>(SI->getOperand(1)->stripPointerCasts()))
155  InitedRoots.insert(AI);
156 
157  // Add root initializers.
158  bool MadeChange = false;
159 
160  for (AllocaInst *Root : Roots)
161  if (!InitedRoots.count(Root)) {
162  new StoreInst(
163  ConstantPointerNull::get(cast<PointerType>(Root->getAllocatedType())),
164  Root, Root->getNextNode());
165  MadeChange = true;
166  }
167 
168  return MadeChange;
169 }
170 
171 /// runOnFunction - Replace gcread/gcwrite intrinsics with loads and stores.
172 /// Leave gcroot intrinsics; the code generator needs to see those.
174  // Quick exit for functions that do not use GC.
175  if (!F.hasGC())
176  return false;
177 
178  GCFunctionInfo &FI = getAnalysis<GCModuleInfo>().getFunctionInfo(F);
179  GCStrategy &S = FI.getStrategy();
180 
181  return DoLowering(F, S);
182 }
183 
184 /// Lower barriers out of existance (if the associated GCStrategy hasn't
185 /// already done so...), and insert initializing stores to roots as a defensive
186 /// measure. Given we're going to report all roots live at all safepoints, we
187 /// need to be able to ensure each root has been initialized by the point the
188 /// first safepoint is reached. This really should have been done by the
189 /// frontend, but the old API made this non-obvious, so we do a potentially
190 /// redundant store just in case.
191 bool LowerIntrinsics::DoLowering(Function &F, GCStrategy &S) {
193 
194  bool MadeChange = false;
195  for (BasicBlock &BB : F)
197  IntrinsicInst *CI = dyn_cast<IntrinsicInst>(&I);
198  if (!CI)
199  continue;
200 
201  Function *F = CI->getCalledFunction();
202  switch (F->getIntrinsicID()) {
203  default: break;
204  case Intrinsic::gcwrite: {
205  // Replace a write barrier with a simple store.
206  Value *St = new StoreInst(CI->getArgOperand(0),
207  CI->getArgOperand(2), CI);
208  CI->replaceAllUsesWith(St);
209  CI->eraseFromParent();
210  MadeChange = true;
211  break;
212  }
213  case Intrinsic::gcread: {
214  // Replace a read barrier with a simple load.
215  Value *Ld = new LoadInst(CI->getType(), CI->getArgOperand(1), "", CI);
216  Ld->takeName(CI);
217  CI->replaceAllUsesWith(Ld);
218  CI->eraseFromParent();
219  MadeChange = true;
220  break;
221  }
222  case Intrinsic::gcroot: {
223  // Initialize the GC root, but do not delete the intrinsic. The
224  // backend needs the intrinsic to flag the stack slot.
225  Roots.push_back(
226  cast<AllocaInst>(CI->getArgOperand(0)->stripPointerCasts()));
227  break;
228  }
229  }
230  }
231 
232  if (Roots.size())
233  MadeChange |= InsertRootInitializers(F, Roots);
234 
235  return MadeChange;
236 }
237 
238 // -----------------------------------------------------------------------------
239 
242 
243 INITIALIZE_PASS(GCMachineCodeAnalysis, "gc-analysis",
244  "Analyze Machine Code For Garbage Collection", false, false)
245 
246 GCMachineCodeAnalysis::GCMachineCodeAnalysis() : MachineFunctionPass(ID) {}
247 
248 void GCMachineCodeAnalysis::getAnalysisUsage(AnalysisUsage &AU) const {
249  MachineFunctionPass::getAnalysisUsage(AU);
250  AU.setPreservesAll();
252 }
253 
254 MCSymbol *GCMachineCodeAnalysis::InsertLabel(MachineBasicBlock &MBB,
256  const DebugLoc &DL) const {
258  BuildMI(MBB, MI, DL, TII->get(TargetOpcode::GC_LABEL)).addSym(Label);
259  return Label;
260 }
261 
262 void GCMachineCodeAnalysis::VisitCallPoint(MachineBasicBlock::iterator CI) {
263  // Find the return address (next instruction), since that's what will be on
264  // the stack when the call is suspended and we need to inspect the stack.
266  ++RAI;
267 
268  MCSymbol *Label = InsertLabel(*CI->getParent(), RAI, CI->getDebugLoc());
269  FI->addSafePoint(Label, CI->getDebugLoc());
270 }
271 
272 void GCMachineCodeAnalysis::FindSafePoints(MachineFunction &MF) {
273  for (MachineBasicBlock &MBB : MF)
274  for (MachineInstr &MI : MBB)
275  if (MI.isCall()) {
276  // Do not treat tail or sibling call sites as safe points. This is
277  // legal since any arguments passed to the callee which live in the
278  // remnants of the callers frame will be owned and updated by the
279  // callee if required.
280  if (MI.isTerminator())
281  continue;
282  VisitCallPoint(&MI);
283  }
284 }
285 
286 void GCMachineCodeAnalysis::FindStackOffsets(MachineFunction &MF) {
288  assert(TFI && "TargetRegisterInfo not available!");
289 
291  RI != FI->roots_end();) {
292  // If the root references a dead object, no need to keep it.
293  if (MF.getFrameInfo().isDeadObjectIndex(RI->Num)) {
294  RI = FI->removeStackRoot(RI);
295  } else {
296  Register FrameReg; // FIXME: surely GCRoot ought to store the
297  // register that the offset is from?
298  auto FrameOffset = TFI->getFrameIndexReference(MF, RI->Num, FrameReg);
299  assert(!FrameOffset.getScalable() &&
300  "Frame offsets with a scalable component are not supported");
301  RI->StackOffset = FrameOffset.getFixed();
302  ++RI;
303  }
304  }
305 }
306 
307 bool GCMachineCodeAnalysis::runOnMachineFunction(MachineFunction &MF) {
308  // Quick exit for functions that do not use GC.
309  if (!MF.getFunction().hasGC())
310  return false;
311 
312  FI = &getAnalysis<GCModuleInfo>().getFunctionInfo(MF.getFunction());
313  TII = MF.getSubtarget().getInstrInfo();
314 
315  // Find the size of the stack frame. There may be no correct static frame
316  // size, we use UINT64_MAX to represent this.
317  const MachineFrameInfo &MFI = MF.getFrameInfo();
318  const TargetRegisterInfo *RegInfo = MF.getSubtarget().getRegisterInfo();
319  const bool DynamicFrameSize =
320  MFI.hasVarSizedObjects() || RegInfo->hasStackRealignment(MF);
321  FI->setFrameSize(DynamicFrameSize ? UINT64_MAX : MFI.getStackSize());
322 
323  // Find all safe points.
324  if (FI->getStrategy().needsSafePoints())
325  FindSafePoints(MF);
326 
327  // Find the concrete stack offsets for all roots (stack slots)
328  FindStackOffsets(MF);
329 
330  return false;
331 }
llvm::MachineFrameInfo::hasVarSizedObjects
bool hasVarSizedObjects() const
This method may be called any time after instruction selection is complete to determine if the stack ...
Definition: MachineFrameInfo.h:353
Lowering
Shadow Stack GC Lowering
Definition: ShadowStackGCLowering.cpp:99
MI
IRTranslator LLVM IR MI
Definition: IRTranslator.cpp:105
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AllocatorList.h:23
GCMetadata.h
llvm::MCSymbol
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:41
M
We currently emits eax Perhaps this is what we really should generate is Is imull three or four cycles eax eax The current instruction priority is based on pattern complexity The former is more complex because it folds a load so the latter will not be emitted Perhaps we should use AddedComplexity to give LEA32r a higher priority We should always try to match LEA first since the LEA matching code does some estimate to determine whether the match is profitable if we care more about code then imull is better It s two bytes shorter than movl leal On a Pentium M
Definition: README.txt:252
TargetFrameLowering.h
INITIALIZE_PASS
INITIALIZE_PASS(GCMachineCodeAnalysis, "gc-analysis", "Analyze Machine Code For Garbage Collection", false, false) GCMachineCodeAnalysis
Definition: GCRootLowering.cpp:243
llvm::TargetFrameLowering
Information about stack frame layout on the target.
Definition: TargetFrameLowering.h:43
llvm::GCStrategy
GCStrategy describes a garbage collector algorithm's code generation requirements,...
Definition: GCStrategy.h:66
llvm::BasicBlock::iterator
InstListType::iterator iterator
Instruction iterators...
Definition: BasicBlock.h:90
IntrinsicInst.h
llvm::Function
Definition: Function.h:62
llvm::MachineFunction::getContext
MCContext & getContext() const
Definition: MachineFunction.h:593
llvm::TargetSubtargetInfo::getInstrInfo
virtual const TargetInstrInfo * getInstrInfo() const
Definition: TargetSubtargetInfo.h:92
llvm::GCFunctionInfo::addSafePoint
void addSafePoint(MCSymbol *Label, const DebugLoc &DL)
addSafePoint - Notes the existence of a safe point.
Definition: GCMetadata.h:125
INITIALIZE_PASS_BEGIN
INITIALIZE_PASS_BEGIN(LowerIntrinsics, "gc-lowering", "GC Lowering", false, false) FunctionPass *llvm
Definition: GCRootLowering.cpp:80
llvm::SmallVector
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Definition: SmallVector.h:1175
ErrorHandling.h
llvm::MachineFunctionPass
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
Definition: MachineFunctionPass.h:30
llvm::GCFunctionInfo
Garbage collection metadata for a single function.
Definition: GCMetadata.h:77
llvm::initializeLowerIntrinsicsPass
void initializeLowerIntrinsicsPass(PassRegistry &)
llvm::TargetSubtargetInfo::getRegisterInfo
virtual const TargetRegisterInfo * getRegisterInfo() const
getRegisterInfo - If register information is available, return it.
Definition: TargetSubtargetInfo.h:124
llvm::TargetRegisterInfo
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
Definition: TargetRegisterInfo.h:233
llvm::GCFunctionInfo::roots_begin
roots_iterator roots_begin()
roots_begin/roots_end - Iterators for all roots in the function.
Definition: GCMetadata.h:139
Module.h
TargetInstrInfo.h
llvm::GCFunctionInfo::getStrategy
GCStrategy & getStrategy()
getStrategy - Return the GC strategy for the function.
Definition: GCMetadata.h:108
llvm::SmallPtrSet
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements.
Definition: SmallPtrSet.h:449
F
#define F(x, y, z)
Definition: MD5.cpp:55
llvm::BasicBlock
LLVM Basic Block Representation.
Definition: BasicBlock.h:58
llvm::GCStrategy::needsSafePoints
bool needsSafePoints() const
True if safe points need to be inferred on call sites.
Definition: GCStrategy.h:111
llvm::TargetInstrInfo
TargetInstrInfo - Interface to description of machine instruction set.
Definition: TargetInstrInfo.h:97
llvm::PassRegistry::getPassRegistry
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
Definition: PassRegistry.cpp:31
CouldBecomeSafePoint
static bool CouldBecomeSafePoint(Instruction *I)
CouldBecomeSafePoint - Predicate to conservatively determine whether the instruction could introduce ...
Definition: GCRootLowering.cpp:117
llvm::CallBase::getCalledFunction
Function * getCalledFunction() const
Returns the function called, or null if this is an indirect function invocation.
Definition: InstrTypes.h:1398
llvm::GCMachineCodeAnalysisID
char & GCMachineCodeAnalysisID
GCMachineCodeAnalysis - Target-independent pass to mark safe points in machine code.
Definition: GCRootLowering.cpp:241
llvm::GCFunctionInfo::setFrameSize
void setFrameSize(uint64_t S)
Definition: GCMetadata.h:131
llvm::AnalysisUsage
Represent the analysis usage information of a pass.
Definition: PassAnalysisSupport.h:47
UINT64_MAX
#define UINT64_MAX
Definition: DataTypes.h:77
IP
Definition: NVPTXLowerArgs.cpp:166
false
Definition: StackSlotColoring.cpp:142
TII
const HexagonInstrInfo * TII
Definition: HexagonCopyToCombine.cpp:127
llvm::Instruction
Definition: Instruction.h:45
llvm::DominatorTreeWrapperPass
Legacy analysis pass which computes a DominatorTree.
Definition: Dominators.h:287
llvm::MachineFrameInfo::getStackSize
uint64_t getStackSize() const
Return the number of bytes that must be allocated to hold all of the fixed size frame objects.
Definition: MachineFrameInfo.h:553
llvm::MachineBasicBlock
Definition: MachineBasicBlock.h:95
llvm::MachineFrameInfo::isDeadObjectIndex
bool isDeadObjectIndex(int ObjectIdx) const
Returns true if the specified index corresponds to a dead object.
Definition: MachineFrameInfo.h:713
INITIALIZE_PASS_END
#define INITIALIZE_PASS_END(passName, arg, name, cfg, analysis)
Definition: PassSupport.h:58
Passes.h
llvm::MachineFunction::getSubtarget
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
Definition: MachineFunction.h:641
llvm::GCLoweringID
char & GCLoweringID
GCLowering Pass - Used by gc.root to perform its default lowering operations.
Definition: GCRootLowering.cpp:88
llvm::StoreInst
An instruction for storing to memory.
Definition: Instructions.h:309
llvm::Instruction::eraseFromParent
SymbolTableList< Instruction >::iterator eraseFromParent()
This method unlinks 'this' from the containing basic block and deletes it.
Definition: Instruction.cpp:78
llvm::MachineInstr
Representation of each machine instruction.
Definition: MachineInstr.h:64
INITIALIZE_PASS_DEPENDENCY
INITIALIZE_PASS_DEPENDENCY(DominatorTreeWrapperPass)
llvm::Function::hasGC
bool hasGC() const
hasGC/getGC/setGC/clearGC - The name of the garbage collection algorithm to use during code generatio...
Definition: Function.h:308
I
#define I(x, y, z)
Definition: MD5.cpp:58
llvm::make_early_inc_range
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:642
MachineFunctionPass.h
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
llvm::MachineFunction::getFrameInfo
MachineFrameInfo & getFrameInfo()
getFrameInfo - Return the frame info object for the current function.
Definition: MachineFunction.h:657
SI
StandardInstrumentations SI(Debug, VerifyEach)
llvm::MachineBasicBlock::getParent
const MachineFunction * getParent() const
Return the MachineFunction containing this basic block.
Definition: MachineBasicBlock.h:229
llvm::createGCLoweringPass
FunctionPass * createGCLoweringPass()
GCLowering Pass - Used by gc.root to perform its default lowering operations.
MachineModuleInfo.h
llvm::Module
A Module instance is used to store all the information related to an LLVM module.
Definition: Module.h:65
gc
rewrite statepoints for gc
Definition: RewriteStatepointsForGC.cpp:228
llvm::SmallPtrSetImpl::count
size_type count(ConstPtrType Ptr) const
count - Return 1 if the specified pointer is in the set, 0 otherwise.
Definition: SmallPtrSet.h:382
llvm::MachineFunction
Definition: MachineFunction.h:241
llvm::ArrayRef
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition: APInt.h:32
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:57
llvm::Value::getType
Type * getType() const
All values are typed, get the type of this value.
Definition: Value.h:255
llvm::AnalysisUsage::addPreserved
AnalysisUsage & addPreserved()
Add the specified Pass class to the set of analyses preserved by this pass.
Definition: PassAnalysisSupport.h:98
llvm::Value::replaceAllUsesWith
void replaceAllUsesWith(Value *V)
Change all uses of this to point to a new Value.
Definition: Value.cpp:532
TargetSubtargetInfo.h
DL
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
Definition: AArch64SLSHardening.cpp:76
S
add sub stmia L5 ldr r0 bl L_printf $stub Instead of a and a wouldn t it be better to do three moves *Return an aggregate type is even return S
Definition: README.txt:210
llvm::MCContext::createTempSymbol
MCSymbol * createTempSymbol()
Create a temporary symbol with a unique name.
Definition: MCContext.cpp:303
llvm::LoadInst
An instruction for reading from memory.
Definition: Instructions.h:180
llvm::Value::stripPointerCasts
const Value * stripPointerCasts() const
Strip off pointer casts, all-zero GEPs and address space casts.
Definition: Value.cpp:685
llvm::Register
Wrapper class representing virtual and physical registers.
Definition: Register.h:19
MBB
MachineBasicBlock & MBB
Definition: AArch64SLSHardening.cpp:74
runOnFunction
static bool runOnFunction(Function &F, bool PostInlining)
Definition: EntryExitInstrumenter.cpp:69
llvm::pdb::PDB_SymType::Label
@ Label
llvm::MachineFunction::getFunction
Function & getFunction()
Return the LLVM function that this machine code represents.
Definition: MachineFunction.h:607
llvm::TargetSubtargetInfo::getFrameLowering
virtual const TargetFrameLowering * getFrameLowering() const
Definition: TargetSubtargetInfo.h:93
llvm::AnalysisUsage::setPreservesAll
void setPreservesAll()
Set by analyses that do not transform their input at all.
Definition: PassAnalysisSupport.h:130
get
Should compile to something r4 addze r3 instead we get
Definition: README.txt:24
MachineFrameInfo.h
llvm::TargetFrameLowering::getFrameIndexReference
virtual StackOffset getFrameIndexReference(const MachineFunction &MF, int FI, Register &FrameReg) const
getFrameIndexReference - This method should return the base register and offset used to reference a f...
Definition: TargetFrameLoweringImpl.cpp:45
InsertRootInitializers
static bool InsertRootInitializers(Function &F, ArrayRef< AllocaInst * > Roots)
Definition: GCRootLowering.cpp:143
llvm::IntrinsicInst
A wrapper class for inspecting calls to intrinsic functions.
Definition: IntrinsicInst.h:45
llvm::TargetRegisterInfo::hasStackRealignment
bool hasStackRealignment(const MachineFunction &MF) const
True if stack realignment is required and still possible.
Definition: TargetRegisterInfo.h:936
llvm::MachineFrameInfo
The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted.
Definition: MachineFrameInfo.h:107
llvm::MachineInstrBuilder::addSym
const MachineInstrBuilder & addSym(MCSymbol *Sym, unsigned char TargetFlags=0) const
Definition: MachineInstrBuilder.h:267
MachineInstrBuilder.h
Dominators.h
llvm::BuildMI
MachineInstrBuilder BuildMI(MachineFunction &MF, const DebugLoc &DL, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
Definition: MachineInstrBuilder.h:328
llvm::CallBase::getArgOperand
Value * getArgOperand(unsigned i) const
Definition: InstrTypes.h:1343
llvm::GCFunctionInfo::removeStackRoot
roots_iterator removeStackRoot(roots_iterator position)
removeStackRoot - Removes a root.
Definition: GCMetadata.h:118
lowering
amdgpu printf runtime AMDGPU Printf lowering
Definition: AMDGPUPrintfRuntimeBinding.cpp:87
llvm::FunctionPass
FunctionPass class - This class is used to implement most global optimizations.
Definition: Pass.h:298
llvm::CallInst
This class represents a function call, abstracting a target machine's calling convention.
Definition: Instructions.h:1478
BB
Common register allocation spilling lr str ldr sxth r3 ldr mla r4 can lr mov lr str ldr sxth r3 mla r4 and then merge mul and lr str ldr sxth r3 mla r4 It also increase the likelihood the store may become dead bb27 Successors according to LLVM BB
Definition: README.txt:39
llvm::GCFunctionInfo::roots_iterator
std::vector< GCRoot >::iterator roots_iterator
Definition: GCMetadata.h:80
llvm::AnalysisUsage::addRequired
AnalysisUsage & addRequired()
Definition: PassAnalysisSupport.h:75
llvm::Value::takeName
void takeName(Value *V)
Transfer the name from V to this value.
Definition: Value.cpp:382
llvm::DebugLoc
A debug info location.
Definition: DebugLoc.h:33
llvm::AllocaInst
an instruction to allocate memory on the stack
Definition: Instructions.h:62
raw_ostream.h
llvm::GCFunctionInfo::roots_end
roots_iterator roots_end()
Definition: GCMetadata.h:140
llvm::MachineInstrBundleIterator< MachineInstr >
llvm::GCModuleInfo
An analysis pass which caches information about the entire Module.
Definition: GCMetadata.h:152
InitializePasses.h
llvm::Value
LLVM Value Representation.
Definition: Value.h:74
TargetRegisterInfo.h
Debug.h
llvm::SmallPtrSetImpl::insert
std::pair< iterator, bool > insert(PtrType Ptr)
Inserts Ptr if and only if there is no element in the container equal to Ptr.
Definition: SmallPtrSet.h:364
llvm::Intrinsic::ID
unsigned ID
Definition: TargetTransformInfo.h:38