diff options
| author | Evan Cheng <evan.cheng@apple.com> | 2010-05-18 20:03:28 +0000 |
|---|---|---|
| committer | Evan Cheng <evan.cheng@apple.com> | 2010-05-18 20:03:28 +0000 |
| commit | e7fc64a5c96f53ac0e028ca46930116823d5048a (patch) | |
| tree | 9212f4ff4d55d8bd59fb3b93f8a0a93ebd4c91ca /llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp | |
| parent | fb7df5317a7512180b9a2a6ee232be10b7f33f68 (diff) | |
| download | bcm5719-llvm-e7fc64a5c96f53ac0e028ca46930116823d5048a.tar.gz bcm5719-llvm-e7fc64a5c96f53ac0e028ca46930116823d5048a.zip | |
Fix PR7162: Use source register classes and sub-indices to determine the correct register class of the definitions of REG_SEQUENCE.
llvm-svn: 104050
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp b/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp index 16bd40ca65a..2f8f255b5b5 100644 --- a/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp @@ -545,16 +545,18 @@ void InstrEmitter::EmitRegSequence(SDNode *Node, const TargetInstrDesc &II = TII->get(TargetOpcode::REG_SEQUENCE); for (unsigned i = 0; i != NumOps; ++i) { SDValue Op = Node->getOperand(i); -#ifndef NDEBUG if (i & 1) { unsigned SubIdx = cast<ConstantSDNode>(Op)->getZExtValue(); unsigned SubReg = getVR(Node->getOperand(i-1), VRBaseMap); const TargetRegisterClass *TRC = MRI->getRegClass(SubReg); const TargetRegisterClass *SRC = - getSuperRegisterRegClass(TRC, SubIdx, Node->getValueType(0)); - assert(SRC == RC && "Invalid subregister index in REG_SEQUENCE"); + TRI->getMatchingSuperRegClass(RC, TRC, SubIdx); + //getSuperRegisterRegClass(TRC, SubIdx, Node->getValueType(0)); + if (!SRC) + llvm_unreachable("Invalid subregister index in REG_SEQUENCE"); + if (SRC != RC) + MRI->setRegClass(NewVReg, SRC); } -#endif AddOperand(MI, Op, i+1, &II, VRBaseMap, /*IsDebug=*/false, IsClone, IsCloned); } |

