34#define DEBUG_TYPE "mips-mulmul-bug-fix"
44 StringRef getPassName()
const override {
return "Mips VR4300 mulmul bugfix"; }
63 "Mips VR4300 mulmul bugfix",
false,
false)
65char MipsMulMulBugFixLegacy::ID = 0;
68 switch (
MI.getOpcode()) {
80 if (
MI.isBranch() ||
MI.isIndirectBranch() ||
MI.isCall())
83 switch (
MI.getOpcode()) {
107 MII !=
E; MII = NextMII) {
138 return new MipsMulMulBugFixLegacy();
141bool MipsMulMulBugFixLegacy::runOnMachineFunction(
MachineFunction &MF) {
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
static bool fixMulMulBB(MachineBasicBlock &MBB, const MipsInstrInfo &MipsII)
static bool isSecondMulOrBranch(const MachineInstr &MI)
static INITIALIZE_PASS(MipsMulMulBugFixLegacy, "mips-mulmul-bug-fix", "Mips VR4300 mulmul bugfix", false, false) char MipsMulMulBugFixLegacy bool isFirstMul(const MachineInstr &MI)
static bool fixMulMulBugInMF(MachineFunction &MF)
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
Represent the analysis usage information of a pass.
LLVM_ABI void setPreservesCFG()
This function should be called by the pass, iff they do not:
Represents analyses that only rely on functions' control flow.
FunctionPass class - This class is used to implement most global optimizations.
Describe properties that are true of each instruction in the target description file.
Instructions::iterator instr_iterator
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
Properties which a MachineFunction may have at a given point in time.
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
Representation of each machine instruction.
PreservedAnalyses run(MachineFunction &MF, MachineFunctionAnalysisManager &MFAM)
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
PreservedAnalyses & preserveSet()
Mark an analysis set as preserved.
Represent a constant reference to a string, i.e.
Pass manager infrastructure for declaring and invalidating analyses.
MipsII - This namespace holds all of the target specific flags that instruction info tracks.
This is an optimization pass for GlobalISel generic memory operations.
IterT next_nodbg(IterT It, IterT End, bool SkipPseudoOp=true)
Increment It, then continue incrementing it while it points to a debug instruction.
MachineInstrBuilder BuildMI(MachineFunction &MF, const MIMetadata &MIMD, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
AnalysisManager< MachineFunction > MachineFunctionAnalysisManager
LLVM_ABI PreservedAnalyses getMachineFunctionPassPreservedAnalyses()
Returns the minimum set of Analyses that all machine function passes must preserve.
LLVM_ABI raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
FunctionPass * createMipsMulMulBugFixLegacyPass()