Go to the documentation of this file.
21 #define DEBUG_TYPE "mir-strip-debug"
27 OnlyDebugifiedDefault(
"mir-strip-debugify-only",
28 cl::desc(
"Should mir-strip-debug only strip debug "
29 "info from debugified modules by default"),
32 struct StripDebugMachineModule :
public ModulePass {
33 bool runOnModule(
Module &
M)
override {
35 NamedMDNode *DebugifyMD =
M.getNamedMetadata(
"llvm.debugify");
38 " (debugify metadata not found)?\n");
44 getAnalysis<MachineModuleInfoWrapperPass>().getMMI();
54 if (
MI.isDebugInstr()) {
59 if (
MI.getNumOperands() > 1) {
66 if (
MI.getDebugLoc()) {
82 StripDebugMachineModule() : StripDebugMachineModule(OnlyDebugifiedDefault) {}
83 StripDebugMachineModule(
bool OnlyDebugified)
102 "Machine Strip Debug Module",
false,
false)
107 return new StripDebugMachineModule(OnlyDebugified);
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
ModulePass class - This class is used to implement unstructured interprocedural optimizations and ana...
instr_iterator erase(instr_iterator I)
Remove an instruction from the instruction list and delete it.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
Represent the analysis usage information of a pass.
This class contains meta information specific to a module.
bool stripDebugifyMetadata(Module &M)
Strip out all of the metadata and debug info inserted by debugify.
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
#define INITIALIZE_PASS_END(passName, arg, name, cfg, analysis)
Representation of each machine instruction.
initializer< Ty > init(const Ty &Val)
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...
A Module instance is used to store all the information related to an LLVM module.
void setPreservesCFG()
This function should be called by the pass, iff they do not:
AnalysisUsage & addPreserved()
Add the specified Pass class to the set of analyses preserved by this pass.
ModulePass * createStripDebugMachineModulePass(bool OnlyDebugified)
Creates MIR Strip Debug pass.
MachineFunction * getMachineFunction(const Function &F) const
Returns the MachineFunction associated to IR function F if there is one, otherwise nullptr.
COFF::MachineTypes Machine
INITIALIZE_PASS_BEGIN(StripDebugMachineModule, DEBUG_TYPE, "Machine Strip Debug Module", false, false) INITIALIZE_PASS_END(StripDebugMachineModule
AnalysisUsage & addRequired()