diff options
author | Anton Korobeynikov <asl@math.spbu.ru> | 2009-07-16 13:42:31 +0000 |
---|---|---|
committer | Anton Korobeynikov <asl@math.spbu.ru> | 2009-07-16 13:42:31 +0000 |
commit | cf7ea6a94f88f7ae8a138d9bdb3479decee381a3 (patch) | |
tree | 34e54bfd3af9ad666cd90b6ba59528bb6fb0750e /llvm/lib/Target/SystemZ/SystemZInstrInfo.cpp | |
parent | bbd751e410ca8c05610e06c0881dcad298967c14 (diff) | |
download | bcm5719-llvm-cf7ea6a94f88f7ae8a138d9bdb3479decee381a3.tar.gz bcm5719-llvm-cf7ea6a94f88f7ae8a138d9bdb3479decee381a3.zip |
Add bunch of 32-bit patterns... Uffff :)
llvm-svn: 75926
Diffstat (limited to 'llvm/lib/Target/SystemZ/SystemZInstrInfo.cpp')
-rw-r--r-- | llvm/lib/Target/SystemZ/SystemZInstrInfo.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/llvm/lib/Target/SystemZ/SystemZInstrInfo.cpp b/llvm/lib/Target/SystemZ/SystemZInstrInfo.cpp index 5137a1534c7..b72d0cfbfb2 100644 --- a/llvm/lib/Target/SystemZ/SystemZInstrInfo.cpp +++ b/llvm/lib/Target/SystemZ/SystemZInstrInfo.cpp @@ -50,10 +50,21 @@ bool SystemZInstrInfo::copyRegToReg(MachineBasicBlock &MBB, DebugLoc DL = DebugLoc::getUnknownLoc(); if (I != MBB.end()) DL = I->getDebugLoc(); - if (DestRC == SrcRC) { + // Determine if DstRC and SrcRC have a common superclass. + const TargetRegisterClass *CommonRC = DestRC; + if (DestRC == SrcRC) + /* Same regclass for source and dest */; + else if (CommonRC->hasSuperClass(SrcRC)) + CommonRC = SrcRC; + else if (!CommonRC->hasSubClass(SrcRC)) + CommonRC = 0; + + if (CommonRC) { unsigned Opc; - if (DestRC == &SystemZ::GR64RegClass) { + if (CommonRC == &SystemZ::GR64RegClass) { Opc = SystemZ::MOV64rr; + } else if (CommonRC == &SystemZ::GR32RegClass) { + Opc = SystemZ::MOV32rr; } else { return false; } @@ -74,6 +85,7 @@ SystemZInstrInfo::isMoveInstr(const MachineInstr& MI, switch (MI.getOpcode()) { default: return false; + case SystemZ::MOV32rr: case SystemZ::MOV64rr: assert(MI.getNumOperands() >= 2 && MI.getOperand(0).isReg() && |