Go to the documentation of this file.
36 cl::desc(
"Disable debug info printing"));
45 UsesMSVCFloatingPoint =
false;
46 DbgInfoAvailable =
false;
59 Context(MMI.
TM.getTargetTriple(), MMI.
TM.getMCAsmInfo(),
60 MMI.
TM.getMCRegisterInfo(), MMI.
TM.getMCSubtargetInfo(), nullptr,
62 MachineFunctions(
std::
move(MMI.MachineFunctions)) {
64 ObjFileMMI = MMI.ObjFileMMI;
65 CurCallSite = MMI.CurCallSite;
66 ExternalContext = MMI.ExternalContext;
67 TheModule = MMI.TheModule;
72 TM->getMCRegisterInfo(),
TM->getMCSubtargetInfo(),
81 TM->getMCRegisterInfo(),
TM->getMCSubtargetInfo(),
83 ExternalContext(ExtContext) {
92 auto I = MachineFunctions.find(&
F);
93 return I != MachineFunctions.end() ?
I->second.get() :
nullptr;
99 if (LastRequest == &
F)
102 auto I = MachineFunctions.insert(
103 std::make_pair(&
F, std::unique_ptr<MachineFunction>()));
111 I.first->second.reset(MF);
113 MF =
I.first->second.get();
122 MachineFunctions.erase(&
F);
123 LastRequest =
nullptr;
124 LastResult =
nullptr;
128 std::unique_ptr<MachineFunction> &&MF) {
129 auto I = MachineFunctions.insert(std::make_pair(&
F,
std::move(MF)));
130 assert(
I.second &&
"machine function already mapped");
150 getAnalysis<MachineModuleInfoWrapperPass>().getMMI();
156 return "Free MachineFunction";
165 return new FreeMachineFunction();
182 "Machine Module Information",
false,
false)
189 const MDNode *LocInfo =
nullptr;
190 if (BufNum > 0 && BufNum <= LocInfos.size())
191 LocInfo = LocInfos[BufNum - 1];
195 unsigned LocCookie = 0;
197 unsigned ErrorLine = SMD.getLineNo() - 1;
203 mdconst::dyn_extract<ConstantInt>(LocInfo->
getOperand(ErrorLine)))
204 LocCookie = CI->getZExtValue();
218 std::vector<const MDNode *> &LocInfos) {
219 unsigned LocCookie = 0;
226 !
M.debug_compile_units().empty();
242 !
M.debug_compile_units().empty();
This is an optimization pass for GlobalISel generic memory operations.
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
bool doFinalization(Module &) override
doFinalization - Virtual method overriden by subclasses to do any necessary clean up after all passes...
const MCContext & getContext() const
ImmutablePass class - This class is used to provide information that does not need to be run.
Context object for machine code objects.
void insertFunction(const Function &F, std::unique_ptr< MachineFunction > &&MF)
Add an externally created MachineFunction MF for F.
virtual ~MachineModuleInfoImpl()
unsigned getNumOperands() const
Return number of MDNode operands.
MachineModuleInfo run(Module &M, ModuleAnalysisManager &)
Run the analysis pass and produce machine module information.
This is the shared class of boolean and integer constants.
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
void setObjectFileInfo(const MCObjectFileInfo *Mofi)
Represent the analysis usage information of a pass.
Instances of this class encapsulate one diagnostic report, allowing printing to a raw_ostream as a ca...
This class contains meta information specific to a module.
const char LLVMTargetMachineRef LLVMPassBuilderOptionsRef Options
MachineModuleInfo(const LLVMTargetMachine *TM=nullptr)
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
void setDiagnosticHandler(DiagHandlerTy DiagHandler)
const MDOperand & getOperand(unsigned I) const
void deleteMachineFunctionFor(Function &F)
Delete the MachineFunction MF and reset the link in the IR Function to Machine Function map.
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
This is an important class for using LLVM in a threaded context.
A special type used by analysis passes to provide an address that identifies that particular analysis...
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
static cl::opt< bool > DisableDebugInfoPrinting("disable-debug-info-print", cl::Hidden, cl::desc("Disable debug info printing"))
A Module instance is used to store all the information related to an LLVM module.
FunctionPass * createFreeMachineFunctionPass()
This pass frees the memory occupied by the MachineFunction.
void initTargetMachineFunctionInfo(const TargetSubtargetInfo &STI)
Initialize the target specific MachineFunctionInfo.
unsigned FindBufferContainingLoc(SMLoc Loc) const
Return the ID of the buffer containing the specified location.
StringRef - Represent a constant reference to a string, i.e.
bool doInitialization(Module &) override
doInitialization - Virtual method overridden by subclasses to do any necessary initialization before ...
AnalysisUsage & addPreserved()
Add the specified Pass class to the set of analyses preserved by this pass.
This owns the files read by a parser, handles include stacks, and handles diagnostic wrangling.
MachineFunction & getOrCreateMachineFunction(Function &F)
Returns the MachineFunction constructed for the IR function F.
TargetSubtargetInfo - Generic base class for all target subtargets.
static bool runOnFunction(Function &F, bool PostInlining)
void diagnose(const DiagnosticInfo &DI)
Report a message to the currently installed diagnostic handler.
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)
MachineFunction * getMachineFunction(const Function &F) const
Returns the MachineFunction associated to IR function F if there is one, otherwise nullptr.
Diagnostic information for SMDiagnostic reporting.
MachineModuleInfoWrapperPass(const LLVMTargetMachine *TM=nullptr)
This class describes a target machine that is implemented with the LLVM target-independent code gener...
virtual const TargetSubtargetInfo * getSubtargetImpl(const Function &) const
Virtual method implemented by subclasses that returns a reference to that target's TargetSubtargetInf...
A container for analyses that lazily runs them and caches their results.
const char LLVMTargetMachineRef TM
FunctionPass class - This class is used to implement most global optimizations.
void initializeMachineModuleInfoWrapperPassPass(PassRegistry &)
AnalysisUsage & addRequired()