LLVM  13.0.0git
MachineModuleInfo.cpp
Go to the documentation of this file.
1 //===-- llvm/CodeGen/MachineModuleInfo.cpp ----------------------*- C++ -*-===//
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 
10 #include "llvm/ADT/ArrayRef.h"
11 #include "llvm/ADT/DenseMap.h"
13 #include "llvm/ADT/StringRef.h"
14 #include "llvm/ADT/TinyPtrVector.h"
16 #include "llvm/CodeGen/Passes.h"
17 #include "llvm/IR/BasicBlock.h"
18 #include "llvm/IR/DerivedTypes.h"
19 #include "llvm/IR/DiagnosticInfo.h"
20 #include "llvm/IR/Instructions.h"
21 #include "llvm/IR/LLVMContext.h"
22 #include "llvm/IR/Module.h"
23 #include "llvm/IR/Value.h"
24 #include "llvm/IR/ValueHandle.h"
25 #include "llvm/InitializePasses.h"
26 #include "llvm/MC/MCContext.h"
27 #include "llvm/MC/MCSymbol.h"
28 #include "llvm/MC/MCSymbolXCOFF.h"
29 #include "llvm/Pass.h"
30 #include "llvm/Support/Casting.h"
34 #include <algorithm>
35 #include <cassert>
36 #include <memory>
37 #include <utility>
38 #include <vector>
39 
40 using namespace llvm;
41 using namespace llvm::dwarf;
42 
43 // Out of line virtual method.
45 
46 namespace llvm {
47 
49  MMIAddrLabelMap *Map = nullptr;
50 
51 public:
52  MMIAddrLabelMapCallbackPtr() = default;
54 
55  void setPtr(BasicBlock *BB) {
57  }
58 
59  void setMap(MMIAddrLabelMap *map) { Map = map; }
60 
61  void deleted() override;
62  void allUsesReplacedWith(Value *V2) override;
63 };
64 
67  struct AddrLabelSymEntry {
68  /// The symbols for the label.
70 
71  Function *Fn; // The containing function of the BasicBlock.
72  unsigned Index; // The index in BBCallbacks for the BasicBlock.
73  };
74 
75  DenseMap<AssertingVH<BasicBlock>, AddrLabelSymEntry> AddrLabelSymbols;
76 
77  /// Callbacks for the BasicBlock's that we have entries for. We use this so
78  /// we get notified if a block is deleted or RAUWd.
79  std::vector<MMIAddrLabelMapCallbackPtr> BBCallbacks;
80 
81  /// This is a per-function list of symbols whose corresponding BasicBlock got
82  /// deleted. These symbols need to be emitted at some point in the file, so
83  /// AsmPrinter emits them after the function body.
84  DenseMap<AssertingVH<Function>, std::vector<MCSymbol*>>
85  DeletedAddrLabelsNeedingEmission;
86 
87 public:
88  MMIAddrLabelMap(MCContext &context) : Context(context) {}
89 
91  assert(DeletedAddrLabelsNeedingEmission.empty() &&
92  "Some labels for deleted blocks never got emitted");
93  }
94 
95  ArrayRef<MCSymbol *> getAddrLabelSymbolToEmit(BasicBlock *BB);
96 
97  void takeDeletedSymbolsForFunction(Function *F,
98  std::vector<MCSymbol*> &Result);
99 
100  void UpdateForDeletedBlock(BasicBlock *BB);
101  void UpdateForRAUWBlock(BasicBlock *Old, BasicBlock *New);
102 };
103 
104 } // end namespace llvm
105 
107  assert(BB->hasAddressTaken() &&
108  "Shouldn't get label for block without address taken");
109  AddrLabelSymEntry &Entry = AddrLabelSymbols[BB];
110 
111  // If we already had an entry for this block, just return it.
112  if (!Entry.Symbols.empty()) {
113  assert(BB->getParent() == Entry.Fn && "Parent changed");
114  return Entry.Symbols;
115  }
116 
117  // Otherwise, this is a new entry, create a new symbol for it and add an
118  // entry to BBCallbacks so we can be notified if the BB is deleted or RAUWd.
119  BBCallbacks.emplace_back(BB);
120  BBCallbacks.back().setMap(this);
121  Entry.Index = BBCallbacks.size() - 1;
122  Entry.Fn = BB->getParent();
123  MCSymbol *Sym = BB->hasAddressTaken() ? Context.createNamedTempSymbol()
124  : Context.createTempSymbol();
125  Entry.Symbols.push_back(Sym);
126  return Entry.Symbols;
127 }
128 
129 /// If we have any deleted symbols for F, return them.
131 takeDeletedSymbolsForFunction(Function *F, std::vector<MCSymbol*> &Result) {
132  DenseMap<AssertingVH<Function>, std::vector<MCSymbol*>>::iterator I =
133  DeletedAddrLabelsNeedingEmission.find(F);
134 
135  // If there are no entries for the function, just return.
136  if (I == DeletedAddrLabelsNeedingEmission.end()) return;
137 
138  // Otherwise, take the list.
139  std::swap(Result, I->second);
140  DeletedAddrLabelsNeedingEmission.erase(I);
141 }
142 
144  // If the block got deleted, there is no need for the symbol. If the symbol
145  // was already emitted, we can just forget about it, otherwise we need to
146  // queue it up for later emission when the function is output.
147  AddrLabelSymEntry Entry = std::move(AddrLabelSymbols[BB]);
148  AddrLabelSymbols.erase(BB);
149  assert(!Entry.Symbols.empty() && "Didn't have a symbol, why a callback?");
150  BBCallbacks[Entry.Index] = nullptr; // Clear the callback.
151 
152  assert((BB->getParent() == nullptr || BB->getParent() == Entry.Fn) &&
153  "Block/parent mismatch");
154 
155  for (MCSymbol *Sym : Entry.Symbols) {
156  if (Sym->isDefined())
157  return;
158 
159  // If the block is not yet defined, we need to emit it at the end of the
160  // function. Add the symbol to the DeletedAddrLabelsNeedingEmission list
161  // for the containing Function. Since the block is being deleted, its
162  // parent may already be removed, we have to get the function from 'Entry'.
163  DeletedAddrLabelsNeedingEmission[Entry.Fn].push_back(Sym);
164  }
165 }
166 
168  // Get the entry for the RAUW'd block and remove it from our map.
169  AddrLabelSymEntry OldEntry = std::move(AddrLabelSymbols[Old]);
170  AddrLabelSymbols.erase(Old);
171  assert(!OldEntry.Symbols.empty() && "Didn't have a symbol, why a callback?");
172 
173  AddrLabelSymEntry &NewEntry = AddrLabelSymbols[New];
174 
175  // If New is not address taken, just move our symbol over to it.
176  if (NewEntry.Symbols.empty()) {
177  BBCallbacks[OldEntry.Index].setPtr(New); // Update the callback.
178  NewEntry = std::move(OldEntry); // Set New's entry.
179  return;
180  }
181 
182  BBCallbacks[OldEntry.Index] = nullptr; // Update the callback.
183 
184  // Otherwise, we need to add the old symbols to the new block's set.
185  llvm::append_range(NewEntry.Symbols, OldEntry.Symbols);
186 }
187 
189  Map->UpdateForDeletedBlock(cast<BasicBlock>(getValPtr()));
190 }
191 
193  Map->UpdateForRAUWBlock(cast<BasicBlock>(getValPtr()), cast<BasicBlock>(V2));
194 }
195 
197  ObjFileMMI = nullptr;
198  CurCallSite = 0;
199  NextFnNum = 0;
200  UsesMSVCFloatingPoint = UsesMorestackAddr = false;
201  HasSplitStack = HasNosplitStack = false;
202  AddrLabelSymbols = nullptr;
203 }
204 
206  Personalities.clear();
207 
208  delete AddrLabelSymbols;
209  AddrLabelSymbols = nullptr;
210 
211  Context.reset();
212  // We don't clear the ExternalContext.
213 
214  delete ObjFileMMI;
215  ObjFileMMI = nullptr;
216 }
217 
219  : TM(std::move(MMI.TM)),
220  Context(MMI.TM.getTargetTriple(), MMI.TM.getMCAsmInfo(),
221  MMI.TM.getMCRegisterInfo(), MMI.TM.getObjFileLowering(),
222  MMI.TM.getMCSubtargetInfo(), nullptr, nullptr, false),
223  MachineFunctions(std::move(MMI.MachineFunctions)) {
224  ObjFileMMI = MMI.ObjFileMMI;
225  CurCallSite = MMI.CurCallSite;
226  UsesMSVCFloatingPoint = MMI.UsesMSVCFloatingPoint;
227  UsesMorestackAddr = MMI.UsesMorestackAddr;
228  HasSplitStack = MMI.HasSplitStack;
229  HasNosplitStack = MMI.HasNosplitStack;
230  AddrLabelSymbols = MMI.AddrLabelSymbols;
231  ExternalContext = MMI.ExternalContext;
232  TheModule = MMI.TheModule;
233 }
234 
236  : TM(*TM), Context(TM->getTargetTriple(), TM->getMCAsmInfo(),
237  TM->getMCRegisterInfo(), TM->getObjFileLowering(),
238  TM->getMCSubtargetInfo(), nullptr, nullptr, false) {
239  initialize();
240 }
241 
243  MCContext *ExtContext)
244  : TM(*TM), Context(TM->getTargetTriple(), TM->getMCAsmInfo(),
245  TM->getMCRegisterInfo(), TM->getObjFileLowering(),
246  TM->getMCSubtargetInfo(), nullptr, nullptr, false),
247  ExternalContext(ExtContext) {
248  initialize();
249 }
250 
252 
253 //===- Address of Block Management ----------------------------------------===//
254 
257  // Lazily create AddrLabelSymbols.
258  if (!AddrLabelSymbols)
259  AddrLabelSymbols = new MMIAddrLabelMap(getContext());
260  return AddrLabelSymbols->getAddrLabelSymbolToEmit(const_cast<BasicBlock*>(BB));
261 }
262 
265  std::vector<MCSymbol*> &Result) {
266  // If no blocks have had their addresses taken, we're done.
267  if (!AddrLabelSymbols) return;
268  return AddrLabelSymbols->
269  takeDeletedSymbolsForFunction(const_cast<Function*>(F), Result);
270 }
271 
272 /// \name Exception Handling
273 /// \{
274 
275 void MachineModuleInfo::addPersonality(const Function *Personality) {
276  if (!llvm::is_contained(Personalities, Personality))
277  Personalities.push_back(Personality);
278 }
279 
280 /// \}
281 
284  auto I = MachineFunctions.find(&F);
285  return I != MachineFunctions.end() ? I->second.get() : nullptr;
286 }
287 
289  // Shortcut for the common case where a sequence of MachineFunctionPasses
290  // all query for the same Function.
291  if (LastRequest == &F)
292  return *LastResult;
293 
294  auto I = MachineFunctions.insert(
295  std::make_pair(&F, std::unique_ptr<MachineFunction>()));
296  MachineFunction *MF;
297  if (I.second) {
298  // No pre-existing machine function, create a new one.
299  const TargetSubtargetInfo &STI = *TM.getSubtargetImpl(F);
300  MF = new MachineFunction(F, TM, STI, NextFnNum++, *this);
301  // Update the set entry.
302  I.first->second.reset(MF);
303  } else {
304  MF = I.first->second.get();
305  }
306 
307  LastRequest = &F;
308  LastResult = MF;
309  return *MF;
310 }
311 
313  MachineFunctions.erase(&F);
314  LastRequest = nullptr;
315  LastResult = nullptr;
316 }
317 
318 namespace {
319 
320 /// This pass frees the MachineFunction object associated with a Function.
321 class FreeMachineFunction : public FunctionPass {
322 public:
323  static char ID;
324 
325  FreeMachineFunction() : FunctionPass(ID) {}
326 
327  void getAnalysisUsage(AnalysisUsage &AU) const override {
330  }
331 
332  bool runOnFunction(Function &F) override {
333  MachineModuleInfo &MMI =
334  getAnalysis<MachineModuleInfoWrapperPass>().getMMI();
336  return true;
337  }
338 
339  StringRef getPassName() const override {
340  return "Free MachineFunction";
341  }
342 };
343 
344 } // end anonymous namespace
345 
347 
349  return new FreeMachineFunction();
350 }
351 
353  const LLVMTargetMachine *TM)
354  : ImmutablePass(ID), MMI(TM) {
356 }
357 
359  const LLVMTargetMachine *TM, MCContext *ExtContext)
360  : ImmutablePass(ID), MMI(TM, ExtContext) {
362 }
363 
364 // Handle the Pass registration stuff necessary to use DataLayout's.
365 INITIALIZE_PASS(MachineModuleInfoWrapperPass, "machinemoduleinfo",
366  "Machine Module Information", false, false)
368 
370  std::vector<const MDNode *> &LocInfos) {
371  // Look up a LocInfo for the buffer this diagnostic is coming from.
372  unsigned BufNum = SrcMgr.FindBufferContainingLoc(SMD.getLoc());
373  const MDNode *LocInfo = nullptr;
374  if (BufNum > 0 && BufNum <= LocInfos.size())
375  LocInfo = LocInfos[BufNum - 1];
376 
377  // If the inline asm had metadata associated with it, pull out a location
378  // cookie corresponding to which line the error occurred on.
379  unsigned LocCookie = 0;
380  if (LocInfo) {
381  unsigned ErrorLine = SMD.getLineNo() - 1;
382  if (ErrorLine >= LocInfo->getNumOperands())
383  ErrorLine = 0;
384 
385  if (LocInfo->getNumOperands() != 0)
386  if (const ConstantInt *CI =
387  mdconst::dyn_extract<ConstantInt>(LocInfo->getOperand(ErrorLine)))
388  LocCookie = CI->getZExtValue();
389  }
390 
391  return LocCookie;
392 }
393 
395  MMI.initialize();
396  MMI.TheModule = &M;
397  // FIXME: Do this for new pass manager.
398  LLVMContext &Ctx = M.getContext();
400  [&Ctx](const SMDiagnostic &SMD, bool IsInlineAsm, const SourceMgr &SrcMgr,
401  std::vector<const MDNode *> &LocInfos) {
402  unsigned LocCookie = 0;
403  if (IsInlineAsm)
404  LocCookie = getLocCookie(SMD, SrcMgr, LocInfos);
405  Ctx.diagnose(DiagnosticInfoSrcMgr(SMD, IsInlineAsm, LocCookie));
406  });
407  MMI.DbgInfoAvailable = !M.debug_compile_units().empty();
408  return false;
409 }
410 
412  MMI.finalize();
413  return false;
414 }
415 
416 AnalysisKey MachineModuleAnalysis::Key;
417 
420  MachineModuleInfo MMI(TM);
421  MMI.TheModule = &M;
422  MMI.DbgInfoAvailable = !M.debug_compile_units().empty();
423  return MMI;
424 }
llvm
Definition: AllocatorList.h:23
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
llvm::SystemZISD::TM
@ TM
Definition: SystemZISelLowering.h:65
llvm::dwarf
Definition: Dwarf.h:35
llvm::MachineModuleInfoWrapperPass::doFinalization
bool doFinalization(Module &) override
doFinalization - Virtual method overriden by subclasses to do any necessary clean up after all passes...
Definition: MachineModuleInfo.cpp:411
llvm::MachineModuleInfo::getContext
const MCContext & getContext() const
Definition: MachineModuleInfo.h:167
llvm::ImmutablePass
ImmutablePass class - This class is used to provide information that does not need to be run.
Definition: Pass.h:269
llvm::MCContext
Context object for machine code objects.
Definition: MCContext.h:71
llvm::Function
Definition: Function.h:61
StringRef.h
Pass.h
llvm::MMIAddrLabelMapCallbackPtr::MMIAddrLabelMapCallbackPtr
MMIAddrLabelMapCallbackPtr(Value *V)
Definition: MachineModuleInfo.cpp:53
ErrorHandling.h
llvm::MMIAddrLabelMap::UpdateForRAUWBlock
void UpdateForRAUWBlock(BasicBlock *Old, BasicBlock *New)
Definition: MachineModuleInfo.cpp:167
DenseMap.h
Module.h
llvm::MCSymbol::isDefined
bool isDefined() const
isDefined - Check if this symbol is defined (i.e., it has an address).
Definition: MCSymbol.h:242
llvm::MachineModuleInfo::~MachineModuleInfo
~MachineModuleInfo()
Definition: MachineModuleInfo.cpp:251
llvm::MMIAddrLabelMapCallbackPtr::allUsesReplacedWith
void allUsesReplacedWith(Value *V2) override
Callback for Value RAUW.
Definition: MachineModuleInfo.cpp:192
llvm::MachineModuleInfo::initialize
void initialize()
Definition: MachineModuleInfo.cpp:196
llvm::MachineModuleInfoImpl::~MachineModuleInfoImpl
virtual ~MachineModuleInfoImpl()
F
#define F(x, y, z)
Definition: MD5.cpp:56
llvm::BasicBlock
LLVM Basic Block Representation.
Definition: BasicBlock.h:58
llvm::MDNode::getNumOperands
unsigned getNumOperands() const
Return number of MDNode operands.
Definition: Metadata.h:1108
Context
LLVMContext & Context
Definition: NVVMIntrRange.cpp:66
llvm::MachineModuleAnalysis::run
MachineModuleInfo run(Module &M, ModuleAnalysisManager &)
Run the analysis pass and produce machine module information.
Definition: MachineModuleInfo.cpp:418
llvm::ConstantInt
This is the shared class of boolean and integer constants.
Definition: Constants.h:77
TargetMachine.h
llvm::PassRegistry::getPassRegistry
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
Definition: PassRegistry.cpp:31
MCContext.h
INITIALIZE_PASS
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
Definition: PassSupport.h:37
llvm::SrcMgr
SourceMgr SrcMgr
Definition: Error.cpp:24
llvm::AnalysisUsage
Represent the analysis usage information of a pass.
Definition: PassAnalysisSupport.h:47
MCSymbol.h
llvm::SMDiagnostic
Instances of this class encapsulate one diagnostic report, allowing printing to a raw_ostream as a ca...
Definition: SourceMgr.h:251
false
Definition: StackSlotColoring.cpp:142
llvm::dwarf::Index
Index
Definition: Dwarf.h:467
llvm::MachineModuleInfo
This class contains meta information specific to a module.
Definition: MachineModuleInfo.h:78
llvm::MachineModuleInfo::MachineModuleInfo
MachineModuleInfo(const LLVMTargetMachine *TM=nullptr)
Definition: MachineModuleInfo.cpp:235
llvm::MMIAddrLabelMapCallbackPtr::setMap
void setMap(MMIAddrLabelMap *map)
Definition: MachineModuleInfo.cpp:59
llvm::MMIAddrLabelMap::getAddrLabelSymbolToEmit
ArrayRef< MCSymbol * > getAddrLabelSymbolToEmit(BasicBlock *BB)
Definition: MachineModuleInfo.cpp:106
llvm::MCContext::setDiagnosticHandler
void setDiagnosticHandler(DiagHandlerTy DiagHandler)
Definition: MCContext.h:415
llvm::MMIAddrLabelMap::UpdateForDeletedBlock
void UpdateForDeletedBlock(BasicBlock *BB)
Definition: MachineModuleInfo.cpp:143
Passes.h
llvm::MDNode::getOperand
const MDOperand & getOperand(unsigned I) const
Definition: Metadata.h:1102
BasicBlock.h
llvm::MMIAddrLabelMap::takeDeletedSymbolsForFunction
void takeDeletedSymbolsForFunction(Function *F, std::vector< MCSymbol * > &Result)
If we have any deleted symbols for F, return them.
Definition: MachineModuleInfo.cpp:131
llvm::MachineModuleInfoWrapperPass
Definition: MachineModuleInfo.h:279
const
aarch64 promote const
Definition: AArch64PromoteConstant.cpp:232
llvm::MachineModuleInfo::deleteMachineFunctionFor
void deleteMachineFunctionFor(Function &F)
Delete the MachineFunction MF and reset the link in the IR Function to Machine Function map.
Definition: MachineModuleInfo.cpp:312
move
compiles ldr LCPI1_0 ldr ldr mov lsr tst moveq r1 ldr LCPI1_1 and r0 bx lr It would be better to do something like to fold the shift into the conditional move
Definition: README.txt:546
llvm::LLVMContext
This is an important class for using LLVM in a threaded context.
Definition: LLVMContext.h:68
llvm::DenseMap
Definition: DenseMap.h:714
MCSymbolXCOFF.h
llvm::AnalysisKey
A special type used by analysis passes to provide an address that identifies that particular analysis...
Definition: PassManager.h:72
I
#define I(x, y, z)
Definition: MD5.cpp:59
llvm::is_contained
bool is_contained(R &&Range, const E &Element)
Wrapper function around std::find to detect if an element exists in a container.
Definition: STLExtras.h:1547
ArrayRef.h
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
llvm::move
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
Definition: STLExtras.h:1540
llvm::MachineModuleInfo::getAddrLabelSymbolToEmit
ArrayRef< MCSymbol * > getAddrLabelSymbolToEmit(const BasicBlock *BB)
Return the symbol to be used for the specified basic block when its address is taken.
Definition: MachineModuleInfo.cpp:256
std::swap
void swap(llvm::BitVector &LHS, llvm::BitVector &RHS)
Implement std::swap in terms of BitVector swap.
Definition: BitVector.h:840
llvm::MMIAddrLabelMapCallbackPtr::setPtr
void setPtr(BasicBlock *BB)
Definition: MachineModuleInfo.cpp:55
MachineModuleInfo.h
llvm::MachineModuleInfo::takeDeletedSymbolsForFunction
void takeDeletedSymbolsForFunction(const Function *F, std::vector< MCSymbol * > &Result)
If the specified function has had any references to address-taken blocks generated,...
Definition: MachineModuleInfo.cpp:264
llvm::Module
A Module instance is used to store all the information related to an LLVM module.
Definition: Module.h:67
llvm::MDNode
Metadata node.
Definition: Metadata.h:897
TinyPtrVector.h
llvm::ValueHandleBase::operator=
Value * operator=(Value *RHS)
Definition: ValueHandle.h:69
llvm::MMIAddrLabelMapCallbackPtr::deleted
void deleted() override
Callback for Value destruction.
Definition: MachineModuleInfo.cpp:188
llvm::MachineFunction
Definition: MachineFunction.h:230
llvm::createFreeMachineFunctionPass
FunctionPass * createFreeMachineFunctionPass()
This pass frees the memory occupied by the MachineFunction.
Definition: MachineModuleInfo.cpp:348
llvm::ArrayRef
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition: APInt.h:32
llvm::SourceMgr::FindBufferContainingLoc
unsigned FindBufferContainingLoc(SMLoc Loc) const
Return the ID of the buffer containing the specified location.
Definition: SourceMgr.cpp:61
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:57
llvm::MachineModuleInfoWrapperPass::doInitialization
bool doInitialization(Module &) override
doInitialization - Virtual method overridden by subclasses to do any necessary initialization before ...
Definition: MachineModuleInfo.cpp:394
TargetLoweringObjectFile.h
llvm::AnalysisUsage::addPreserved
AnalysisUsage & addPreserved()
Add the specified Pass class to the set of analyses preserved by this pass.
Definition: PassAnalysisSupport.h:98
llvm::SourceMgr
This owns the files read by a parser, handles include stacks, and handles diagnostic wrangling.
Definition: SourceMgr.h:31
llvm::append_range
void append_range(Container &C, Range &&R)
Wrapper function to append a range to a container.
Definition: STLExtras.h:1667
llvm::MachineModuleInfo::getOrCreateMachineFunction
MachineFunction & getOrCreateMachineFunction(Function &F)
Returns the MachineFunction constructed for the IR function F.
Definition: MachineModuleInfo.cpp:288
llvm::MMIAddrLabelMap
Definition: MachineModuleInfo.cpp:65
ValueHandle.h
llvm::TargetSubtargetInfo
TargetSubtargetInfo - Generic base class for all target subtargets.
Definition: TargetSubtargetInfo.h:59
llvm::DenseMapBase< DenseMap< KeyT, ValueT, DenseMapInfo< KeyT >, llvm::detail::DenseMapPair< KeyT, ValueT > >, KeyT, ValueT, DenseMapInfo< KeyT >, llvm::detail::DenseMapPair< KeyT, ValueT > >::empty
LLVM_NODISCARD bool empty() const
Definition: DenseMap.h:97
runOnFunction
static bool runOnFunction(Function &F, bool PostInlining)
Definition: EntryExitInstrumenter.cpp:69
llvm::NVPTX::PTXLdStInstCode::V2
@ V2
Definition: NVPTX.h:123
llvm::LLVMContext::diagnose
void diagnose(const DiagnosticInfo &DI)
Report a message to the currently installed diagnostic handler.
Definition: LLVMContext.cpp:228
std
Definition: BitVector.h:838
getLocCookie
static INITIALIZE_PASS(MachineModuleInfoWrapperPass, "machinemoduleinfo", "Machine Module Information", false, false) char MachineModuleInfoWrapperPass unsigned getLocCookie(const SMDiagnostic &SMD, const SourceMgr &SrcMgr, std::vector< const MDNode * > &LocInfos)
Definition: MachineModuleInfo.cpp:369
llvm::MachineModuleInfo::getMachineFunction
MachineFunction * getMachineFunction(const Function &F) const
Returns the MachineFunction associated to IR function F if there is one, otherwise nullptr.
Definition: MachineModuleInfo.cpp:283
llvm::DiagnosticInfoSrcMgr
Diagnostic information for SMDiagnostic reporting.
Definition: DiagnosticInfo.h:1039
Casting.h
DiagnosticInfo.h
llvm::MMIAddrLabelMap::~MMIAddrLabelMap
~MMIAddrLabelMap()
Definition: MachineModuleInfo.cpp:90
llvm::MachineModuleInfoWrapperPass::MachineModuleInfoWrapperPass
MachineModuleInfoWrapperPass(const LLVMTargetMachine *TM=nullptr)
Definition: MachineModuleInfo.cpp:352
llvm::LLVMTargetMachine
This class describes a target machine that is implemented with the LLVM target-independent code gener...
Definition: TargetMachine.h:385
llvm::CallbackVH
Value handle with callbacks on RAUW and destruction.
Definition: ValueHandle.h:383
Instructions.h
PostOrderIterator.h
llvm::TargetMachine::getSubtargetImpl
virtual const TargetSubtargetInfo * getSubtargetImpl(const Function &) const
Virtual method implemented by subclasses that returns a reference to that target's TargetSubtargetInf...
Definition: TargetMachine.h:130
llvm::MachineModuleInfo::addPersonality
void addPersonality(const Function *Personality)
Provide the personality function for the exception information.
Definition: MachineModuleInfo.cpp:275
DerivedTypes.h
llvm::AnalysisManager
A container for analyses that lazily runs them and caches their results.
Definition: InstructionSimplify.h:44
llvm::FunctionPass
FunctionPass class - This class is used to implement most global optimizations.
Definition: Pass.h:298
llvm::initializeMachineModuleInfoWrapperPassPass
void initializeMachineModuleInfoWrapperPassPass(PassRegistry &)
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::MMIAddrLabelMap::MMIAddrLabelMap
MMIAddrLabelMap(MCContext &context)
Definition: MachineModuleInfo.cpp:88
llvm::AnalysisUsage::addRequired
AnalysisUsage & addRequired()
Definition: PassAnalysisSupport.h:75
LLVMContext.h
llvm::MachineModuleInfo::finalize
void finalize()
Definition: MachineModuleInfo.cpp:205
llvm::TinyPtrVector
TinyPtrVector - This class is specialized for cases where there are normally 0 or 1 element in a vect...
Definition: TinyPtrVector.h:30
MachineFunction.h
Value.h
InitializePasses.h
llvm::Value
LLVM Value Representation.
Definition: Value.h:75
llvm::MMIAddrLabelMapCallbackPtr
Definition: MachineModuleInfo.cpp:48
llvm::Intrinsic::ID
unsigned ID
Definition: TargetTransformInfo.h:38