LLVM  14.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.getMCSubtargetInfo(), nullptr,
222  nullptr, false),
223  MachineFunctions(std::move(MMI.MachineFunctions)) {
224  Context.setObjectFileInfo(MMI.TM.getObjFileLowering());
225  ObjFileMMI = MMI.ObjFileMMI;
226  CurCallSite = MMI.CurCallSite;
227  UsesMSVCFloatingPoint = MMI.UsesMSVCFloatingPoint;
228  UsesMorestackAddr = MMI.UsesMorestackAddr;
229  HasSplitStack = MMI.HasSplitStack;
230  HasNosplitStack = MMI.HasNosplitStack;
231  AddrLabelSymbols = MMI.AddrLabelSymbols;
232  ExternalContext = MMI.ExternalContext;
233  TheModule = MMI.TheModule;
234 }
235 
237  : TM(*TM), Context(TM->getTargetTriple(), TM->getMCAsmInfo(),
238  TM->getMCRegisterInfo(), TM->getMCSubtargetInfo(),
239  nullptr, nullptr, false) {
240  Context.setObjectFileInfo(TM->getObjFileLowering());
241  initialize();
242 }
243 
245  MCContext *ExtContext)
246  : TM(*TM), Context(TM->getTargetTriple(), TM->getMCAsmInfo(),
247  TM->getMCRegisterInfo(), TM->getMCSubtargetInfo(),
248  nullptr, nullptr, false),
249  ExternalContext(ExtContext) {
250  Context.setObjectFileInfo(TM->getObjFileLowering());
251  initialize();
252 }
253 
255 
256 //===- Address of Block Management ----------------------------------------===//
257 
260  // Lazily create AddrLabelSymbols.
261  if (!AddrLabelSymbols)
262  AddrLabelSymbols = new MMIAddrLabelMap(getContext());
263  return AddrLabelSymbols->getAddrLabelSymbolToEmit(const_cast<BasicBlock*>(BB));
264 }
265 
268  std::vector<MCSymbol*> &Result) {
269  // If no blocks have had their addresses taken, we're done.
270  if (!AddrLabelSymbols) return;
271  return AddrLabelSymbols->
272  takeDeletedSymbolsForFunction(const_cast<Function*>(F), Result);
273 }
274 
275 /// \name Exception Handling
276 /// \{
277 
278 void MachineModuleInfo::addPersonality(const Function *Personality) {
279  if (!llvm::is_contained(Personalities, Personality))
280  Personalities.push_back(Personality);
281 }
282 
283 /// \}
284 
287  auto I = MachineFunctions.find(&F);
288  return I != MachineFunctions.end() ? I->second.get() : nullptr;
289 }
290 
292  // Shortcut for the common case where a sequence of MachineFunctionPasses
293  // all query for the same Function.
294  if (LastRequest == &F)
295  return *LastResult;
296 
297  auto I = MachineFunctions.insert(
298  std::make_pair(&F, std::unique_ptr<MachineFunction>()));
299  MachineFunction *MF;
300  if (I.second) {
301  // No pre-existing machine function, create a new one.
302  const TargetSubtargetInfo &STI = *TM.getSubtargetImpl(F);
303  MF = new MachineFunction(F, TM, STI, NextFnNum++, *this);
304  // Update the set entry.
305  I.first->second.reset(MF);
306  } else {
307  MF = I.first->second.get();
308  }
309 
310  LastRequest = &F;
311  LastResult = MF;
312  return *MF;
313 }
314 
316  MachineFunctions.erase(&F);
317  LastRequest = nullptr;
318  LastResult = nullptr;
319 }
320 
321 namespace {
322 
323 /// This pass frees the MachineFunction object associated with a Function.
324 class FreeMachineFunction : public FunctionPass {
325 public:
326  static char ID;
327 
328  FreeMachineFunction() : FunctionPass(ID) {}
329 
330  void getAnalysisUsage(AnalysisUsage &AU) const override {
333  }
334 
335  bool runOnFunction(Function &F) override {
336  MachineModuleInfo &MMI =
337  getAnalysis<MachineModuleInfoWrapperPass>().getMMI();
339  return true;
340  }
341 
342  StringRef getPassName() const override {
343  return "Free MachineFunction";
344  }
345 };
346 
347 } // end anonymous namespace
348 
350 
352  return new FreeMachineFunction();
353 }
354 
356  const LLVMTargetMachine *TM)
357  : ImmutablePass(ID), MMI(TM) {
359 }
360 
362  const LLVMTargetMachine *TM, MCContext *ExtContext)
363  : ImmutablePass(ID), MMI(TM, ExtContext) {
365 }
366 
367 // Handle the Pass registration stuff necessary to use DataLayout's.
368 INITIALIZE_PASS(MachineModuleInfoWrapperPass, "machinemoduleinfo",
369  "Machine Module Information", false, false)
371 
373  std::vector<const MDNode *> &LocInfos) {
374  // Look up a LocInfo for the buffer this diagnostic is coming from.
375  unsigned BufNum = SrcMgr.FindBufferContainingLoc(SMD.getLoc());
376  const MDNode *LocInfo = nullptr;
377  if (BufNum > 0 && BufNum <= LocInfos.size())
378  LocInfo = LocInfos[BufNum - 1];
379 
380  // If the inline asm had metadata associated with it, pull out a location
381  // cookie corresponding to which line the error occurred on.
382  unsigned LocCookie = 0;
383  if (LocInfo) {
384  unsigned ErrorLine = SMD.getLineNo() - 1;
385  if (ErrorLine >= LocInfo->getNumOperands())
386  ErrorLine = 0;
387 
388  if (LocInfo->getNumOperands() != 0)
389  if (const ConstantInt *CI =
390  mdconst::dyn_extract<ConstantInt>(LocInfo->getOperand(ErrorLine)))
391  LocCookie = CI->getZExtValue();
392  }
393 
394  return LocCookie;
395 }
396 
398  MMI.initialize();
399  MMI.TheModule = &M;
400  // FIXME: Do this for new pass manager.
401  LLVMContext &Ctx = M.getContext();
403  [&Ctx](const SMDiagnostic &SMD, bool IsInlineAsm, const SourceMgr &SrcMgr,
404  std::vector<const MDNode *> &LocInfos) {
405  unsigned LocCookie = 0;
406  if (IsInlineAsm)
407  LocCookie = getLocCookie(SMD, SrcMgr, LocInfos);
408  Ctx.diagnose(DiagnosticInfoSrcMgr(SMD, IsInlineAsm, LocCookie));
409  });
410  MMI.DbgInfoAvailable = !M.debug_compile_units().empty();
411  return false;
412 }
413 
415  MMI.finalize();
416  return false;
417 }
418 
419 AnalysisKey MachineModuleAnalysis::Key;
420 
423  MachineModuleInfo MMI(TM);
424  MMI.TheModule = &M;
425  MMI.DbgInfoAvailable = !M.debug_compile_units().empty();
426  return MMI;
427 }
llvm
This file implements support for optimizing divisions by a constant.
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::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:414
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:72
llvm::Function
Definition: Function.h:62
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:243
llvm::MachineModuleInfo::~MachineModuleInfo
~MachineModuleInfo()
Definition: MachineModuleInfo.cpp:254
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:1143
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:421
llvm::ConstantInt
This is the shared class of boolean and integer constants.
Definition: Constants.h:79
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::MCContext::setObjectFileInfo
void setObjectFileInfo(const MCObjectFileInfo *Mofi)
Definition: MCContext.h:421
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:236
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:417
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:1137
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:315
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:1616
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:1609
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:259
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:267
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:906
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:234
llvm::createFreeMachineFunctionPass
FunctionPass * createFreeMachineFunctionPass()
This pass frees the memory occupied by the MachineFunction.
Definition: MachineModuleInfo.cpp:351
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:58
llvm::MachineModuleInfoWrapperPass::doInitialization
bool doInitialization(Module &) override
doInitialization - Virtual method overridden by subclasses to do any necessary initialization before ...
Definition: MachineModuleInfo.cpp:397
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:1748
llvm::MachineModuleInfo::getOrCreateMachineFunction
MachineFunction & getOrCreateMachineFunction(Function &F)
Returns the MachineFunction constructed for the IR function F.
Definition: MachineModuleInfo.cpp:291
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:372
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:286
llvm::DiagnosticInfoSrcMgr
Diagnostic information for SMDiagnostic reporting.
Definition: DiagnosticInfo.h:1050
Casting.h
DiagnosticInfo.h
llvm::MMIAddrLabelMap::~MMIAddrLabelMap
~MMIAddrLabelMap()
Definition: MachineModuleInfo.cpp:90
llvm::MachineModuleInfoWrapperPass::MachineModuleInfoWrapperPass
MachineModuleInfoWrapperPass(const LLVMTargetMachine *TM=nullptr)
Definition: MachineModuleInfo.cpp:355
llvm::LLVMTargetMachine
This class describes a target machine that is implemented with the LLVM target-independent code gener...
Definition: TargetMachine.h:393
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:135
llvm::MachineModuleInfo::addPersonality
void addPersonality(const Function *Personality)
Provide the personality function for the exception information.
Definition: MachineModuleInfo.cpp:278
DerivedTypes.h
llvm::AnalysisManager
A container for analyses that lazily runs them and caches their results.
Definition: InstructionSimplify.h:44
TM
const char LLVMTargetMachineRef TM
Definition: PassBuilderBindings.cpp:47
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:74
llvm::MMIAddrLabelMapCallbackPtr
Definition: MachineModuleInfo.cpp:48
llvm::Intrinsic::ID
unsigned ID
Definition: TargetTransformInfo.h:37