35 SystemZCopyPhysRegsLegacy() : MachineFunctionPass(ID) {}
38 void getAnalysisUsage(AnalysisUsage &AU)
const override;
41char SystemZCopyPhysRegsLegacy::ID = 0;
46 "SystemZ Copy Physregs",
false,
false)
50 return new SystemZCopyPhysRegsLegacy();
53void SystemZCopyPhysRegsLegacy::getAnalysisUsage(
AnalysisUsage &AU)
const {
76 (SrcReg == SystemZ::CC || SystemZ::AR32BitRegClass.contains(SrcReg))) {
77 Register Tmp =
MRI->createVirtualRegister(&SystemZ::GR32BitRegClass);
78 if (SrcReg == SystemZ::CC)
82 MI->getOperand(1).setReg(Tmp);
86 SystemZ::AR32BitRegClass.contains(DstReg)) {
87 Register Tmp =
MRI->createVirtualRegister(&SystemZ::GR32BitRegClass);
88 MI->getOperand(0).setReg(Tmp);
92 MBB.getParent()->substituteDebugValuesForInst(*
MI, *NMI);
112bool SystemZCopyPhysRegsLegacy::runOnMachineFunction(
MachineFunction &MF) {
MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL
MachineBasicBlock MachineBasicBlock::iterator MBBI
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
const HexagonInstrInfo * TII
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
MachineRegisterInfo & MRI
static bool visitMBB(MachineBasicBlock &MBB, MachineRegisterInfo *MRI, const TargetInstrInfo *TII)
static bool runCopyPhysRegsOnMF(MachineFunction &F)
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.
MachineInstrBundleIterator< MachineInstr > 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.
const MachineInstrBuilder & addReg(Register RegNo, RegState Flags={}, unsigned SubReg=0) const
Add a new virtual register operand.
Representation of each machine instruction.
MachineRegisterInfo - Keep track of information for virtual and physical registers,...
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
PreservedAnalyses & preserveSet()
Mark an analysis set as preserved.
Wrapper class representing virtual and physical registers.
constexpr bool isVirtual() const
Return true if the specified register number is in the virtual register namespace.
PreservedAnalyses run(MachineFunction &MF, MachineFunctionAnalysisManager &MFAM)
TargetInstrInfo - Interface to description of machine instruction set.
Pass manager infrastructure for declaring and invalidating analyses.
This is an optimization pass for GlobalISel generic memory operations.
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.
FunctionPass * createSystemZCopyPhysRegsLegacyPass(SystemZTargetMachine &TM)