17#ifndef LLVM_LIB_CODEGEN_MIRVREGNAMERUTILS_H
18#define LLVM_LIB_CODEGEN_MIRVREGNAMERUTILS_H
27class MachineBasicBlock;
29class MachineRegisterInfo;
40 NamedVReg(
Register Reg, std::string Name =
"") : Reg(Reg), Name(Name) {}
41 NamedVReg(std::string Name =
"") : Reg(~0U), Name(Name) {}
43 const std::string &getName()
const {
return Name; }
45 Register getReg()
const {
return Reg; }
50 unsigned CurrentBBNumber = 0;
64 std::map<unsigned, unsigned>
65 getVRegRenameMap(
const std::vector<NamedVReg> &VRegs);
68 bool doVRegRenaming(
const std::map<unsigned, unsigned> &
VRegRenameMap);
73 unsigned createVirtualRegister(
unsigned VReg);
76 unsigned createVirtualRegisterWithLowerName(
unsigned VReg,
StringRef Name);
90 CurrentBBNumber = BBNum;
91 return renameInstsInMBB(
MBB);
unsigned const MachineRegisterInfo * MRI
std::map< unsigned, unsigned > VRegRenameMap
Representation of each machine instruction.
MachineRegisterInfo - Keep track of information for virtual and physical registers,...
Wrapper class representing virtual and physical registers.
StringRef - Represent a constant reference to a string, i.e.
VRegRenamer - This class is used for renaming vregs in a machine basic block according to semantics o...
VRegRenamer(MachineRegisterInfo &MRI)
bool renameVRegs(MachineBasicBlock *MBB, unsigned BBNum)
Same as the above, but sets a BBNum depending on BB traversal that will be used as prefix for the vre...
This is an optimization pass for GlobalISel generic memory operations.