diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-05-04 19:02:04 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-05-04 19:02:04 +0000 |
commit | 093a94cdaefa22c42e1a6013e6ac2209a40e00a5 (patch) | |
tree | 1d53026172f063c0e966ac3f0cc24082c5b8fabb | |
parent | e7528c45eae57aae0b45dbbed19f6b9b3838364e (diff) | |
download | bcm5719-llvm-093a94cdaefa22c42e1a6013e6ac2209a40e00a5.tar.gz bcm5719-llvm-093a94cdaefa22c42e1a6013e6ac2209a40e00a5.zip |
Implement SystemZRegisterInfo::getMatchingSuperRegClass to enable cross-class joins.
llvm-svn: 130857
-rw-r--r-- | llvm/lib/Target/SystemZ/SystemZRegisterInfo.cpp | 14 | ||||
-rw-r--r-- | llvm/lib/Target/SystemZ/SystemZRegisterInfo.h | 4 |
2 files changed, 18 insertions, 0 deletions
diff --git a/llvm/lib/Target/SystemZ/SystemZRegisterInfo.cpp b/llvm/lib/Target/SystemZ/SystemZRegisterInfo.cpp index 28f94f4b6c6..18b82f3a6cf 100644 --- a/llvm/lib/Target/SystemZ/SystemZRegisterInfo.cpp +++ b/llvm/lib/Target/SystemZ/SystemZRegisterInfo.cpp @@ -58,6 +58,20 @@ BitVector SystemZRegisterInfo::getReservedRegs(const MachineFunction &MF) const return Reserved; } +const TargetRegisterClass* +SystemZRegisterInfo::getMatchingSuperRegClass(const TargetRegisterClass *A, + const TargetRegisterClass *B, + unsigned Idx) const { + switch(Idx) { + // Exact sub-classes don't exist for the other sub-register indexes. + default: return 0; + case SystemZ::subreg_32bit: + if (B == SystemZ::ADDR32RegisterClass) + return A->getSize() == 8 ? SystemZ::ADDR64RegisterClass : 0; + return A; + } +} + void SystemZRegisterInfo:: eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB, MachineBasicBlock::iterator I) const { diff --git a/llvm/lib/Target/SystemZ/SystemZRegisterInfo.h b/llvm/lib/Target/SystemZ/SystemZRegisterInfo.h index b45079889a2..6379fd3510b 100644 --- a/llvm/lib/Target/SystemZ/SystemZRegisterInfo.h +++ b/llvm/lib/Target/SystemZ/SystemZRegisterInfo.h @@ -34,6 +34,10 @@ struct SystemZRegisterInfo : public SystemZGenRegisterInfo { BitVector getReservedRegs(const MachineFunction &MF) const; + const TargetRegisterClass* + getMatchingSuperRegClass(const TargetRegisterClass *A, + const TargetRegisterClass *B, unsigned Idx) const; + void eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB, MachineBasicBlock::iterator I) const; |