mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
Add a TargetRegisterInfo::composeSubRegIndices hook with a default
implementation that is correct for most targets. Tablegen will override where needed. Add MachineOperand::subst{Virt,Phys}Reg methods that correctly handle existing subreg indices when sustituting registers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104985 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -27,6 +27,7 @@ class MachineInstr;
|
||||
class MachineRegisterInfo;
|
||||
class MDNode;
|
||||
class TargetMachine;
|
||||
class TargetRegisterInfo;
|
||||
class raw_ostream;
|
||||
class MCSymbol;
|
||||
|
||||
@@ -246,7 +247,20 @@ public:
|
||||
assert(isReg() && "Wrong MachineOperand accessor");
|
||||
SubReg = (unsigned char)subReg;
|
||||
}
|
||||
|
||||
|
||||
/// substVirtReg - Substitute the current register with the virtual
|
||||
/// subregister Reg:SubReg. Take any existing SubReg index into account,
|
||||
/// using TargetRegisterInfo to compose the subreg indices if necessary.
|
||||
/// Reg must be a virtual register, SubIdx can be 0.
|
||||
///
|
||||
void substVirtReg(unsigned Reg, unsigned SubIdx, const TargetRegisterInfo&);
|
||||
|
||||
/// substPhysReg - Substitute the current register with the physical register
|
||||
/// Reg, taking any existing SubReg into account. For instance,
|
||||
/// substPhysReg(%EAX) will change %reg1024:sub_8bit to %AL.
|
||||
///
|
||||
void substPhysReg(unsigned Reg, const TargetRegisterInfo&);
|
||||
|
||||
void setIsUse(bool Val = true) {
|
||||
assert(isReg() && "Wrong MachineOperand accessor");
|
||||
assert((Val || !isDebug()) && "Marking a debug operation as def");
|
||||
|
Reference in New Issue
Block a user