19 #define GET_REGINFO_TARGET_DESC
20 #include "SystemZGenRegisterInfo.inc"
29 Attribute::SwiftError))
30 return CSR_SystemZ_SwiftError_SaveList;
31 return CSR_SystemZ_SaveList;
39 Attribute::SwiftError))
40 return CSR_SystemZ_SwiftError_RegMask;
41 return CSR_SystemZ_RegMask;
51 Reserved.
set(SystemZ::R11D);
52 Reserved.
set(SystemZ::R11L);
53 Reserved.
set(SystemZ::R11H);
54 Reserved.
set(SystemZ::R10Q);
58 Reserved.
set(SystemZ::R15D);
59 Reserved.
set(SystemZ::R15L);
60 Reserved.
set(SystemZ::R15H);
61 Reserved.
set(SystemZ::R14Q);
64 Reserved.
set(SystemZ::A0);
65 Reserved.
set(SystemZ::A1);
72 int SPAdj,
unsigned FIOperandNum,
74 assert(SPAdj == 0 &&
"Outgoing arguments should be part of the frame");
84 int FrameIndex = MI->getOperand(FIOperandNum).getIndex();
87 MI->getOperand(FIOperandNum + 1).getImm());
90 if (MI->isDebugValue()) {
91 MI->getOperand(FIOperandNum).ChangeToRegister(BasePtr,
false);
92 MI->getOperand(FIOperandNum + 1).ChangeToImmediate(Offset);
98 unsigned Opcode = MI->getOpcode();
99 unsigned OpcodeForOffset =
TII->getOpcodeForOffset(Opcode, Offset);
100 if (OpcodeForOffset) {
104 OpcodeForOffset = SystemZ::LDE32;
106 MI->getOperand(FIOperandNum).ChangeToRegister(BasePtr,
false);
111 int64_t OldOffset =
Offset;
112 int64_t
Mask = 0xffff;
114 Offset = OldOffset &
Mask;
115 OpcodeForOffset =
TII->getOpcodeForOffset(Opcode, Offset);
117 assert(Mask &&
"One offset must be OK");
118 }
while (!OpcodeForOffset);
120 unsigned ScratchReg =
122 int64_t HighOffset = OldOffset -
Offset;
125 && MI->getOperand(FIOperandNum + 2).getReg() == 0) {
128 TII->loadImmediate(MBB, MI, ScratchReg, HighOffset);
129 MI->getOperand(FIOperandNum).ChangeToRegister(BasePtr,
false);
130 MI->getOperand(FIOperandNum + 2).ChangeToRegister(ScratchReg,
134 unsigned LAOpcode =
TII->getOpcodeForOffset(SystemZ::LA, HighOffset);
136 BuildMI(MBB, MI, DL,
TII->get(LAOpcode),ScratchReg)
141 TII->loadImmediate(MBB, MI, ScratchReg, HighOffset);
142 BuildMI(MBB, MI, DL,
TII->get(SystemZ::AGR),ScratchReg)
147 MI->getOperand(FIOperandNum).ChangeToRegister(ScratchReg,
151 MI->setDesc(
TII->get(OpcodeForOffset));
152 MI->getOperand(FIOperandNum + 1).ChangeToImmediate(Offset);
158 return TFI->
hasFP(MF) ? SystemZ::R11D : SystemZ::R15D;
const MachineFunction * getParent() const
Return the MachineFunction containing this basic block.
bool hasFP(const MachineFunction &MF) const override
hasFP - Return true if the specified function should have a dedicated frame pointer register...
BitVector getReservedRegs(const MachineFunction &MF) const override
unsigned createVirtualRegister(const TargetRegisterClass *RegClass)
createVirtualRegister - Create and return a new virtual register in the function with the specified r...
uint16_t MCPhysReg
An unsigned integer type large enough to represent all physical registers, but not necessarily virtua...
const Function * getFunction() const
getFunction - Return the LLVM function that this machine code represents
void eliminateFrameIndex(MachineBasicBlock::iterator MI, int SPAdj, unsigned FIOperandNum, RegScavenger *RS) const override
int getFrameIndexReference(const MachineFunction &MF, int FI, unsigned &FrameReg) const override
getFrameIndexReference - This method should return the base register and offset used to reference a f...
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
const HexagonInstrInfo * TII
unsigned getFrameRegister(const MachineFunction &MF) const override
const MachineInstrBuilder & addImm(int64_t Val) const
Add a new immediate operand.
const uint32_t * getCallPreservedMask(const MachineFunction &MF, CallingConv::ID CC) const override
virtual bool supportSwiftError() const
Return true if the target supports swifterror attribute.
MachineInstrBuilder BuildMI(MachineFunction &MF, const DebugLoc &DL, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
const MCPhysReg * getCalleeSavedRegs(const MachineFunction *MF) const override
virtual const TargetLowering * getTargetLowering() const
AttributeSet getAttributes() const
Return the attribute list for this Function.
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
bool hasAttrSomewhere(Attribute::AttrKind Kind, unsigned *Index=nullptr) const
Return true if the specified attribute is set for at least one parameter or for the return value...
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
virtual const TargetInstrInfo * getInstrInfo() const
std::underlying_type< E >::type Mask()
Get a bitmask with 1s in all places up to the high-order bit of E's largest value.
const MachineInstrBuilder & addReg(unsigned RegNo, unsigned flags=0, unsigned SubReg=0) const
Add a new virtual register operand.