Skip to content

Commit cdc0cba

Browse files
author
Krzysztof Parzyszek
committed
[SDAG] Ignore chain operand in REG_SEQUENCE when emitting instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@349186 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent f2511ab commit cdc0cba

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/CodeGen/SelectionDAG/InstrEmitter.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -652,6 +652,10 @@ void InstrEmitter::EmitRegSequence(SDNode *Node,
652652
const MCInstrDesc &II = TII->get(TargetOpcode::REG_SEQUENCE);
653653
MachineInstrBuilder MIB = BuildMI(*MF, Node->getDebugLoc(), II, NewVReg);
654654
unsigned NumOps = Node->getNumOperands();
655+
// REG_SEQUENCE can "inherit" a chain from a subnode.
656+
if (NumOps && Node->getOperand(NumOps-1).getValueType() == MVT::Other)
657+
--NumOps; // Ignore chain if it exists.
658+
655659
assert((NumOps & 1) == 1 &&
656660
"REG_SEQUENCE must have an odd number of operands!");
657661
for (unsigned i = 1; i != NumOps; ++i) {

0 commit comments

Comments
 (0)