From 8a969fb82492cd8cb2d686245eea33a2e390b232 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 21 Feb 2010 06:58:27 +0000 Subject: [PATCH] fix two bugs in OPC_EmitRegister, which makes ppc happier. llvm-svn: 96728 --- include/llvm/CodeGen/DAGISelHeader.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/include/llvm/CodeGen/DAGISelHeader.h b/include/llvm/CodeGen/DAGISelHeader.h index 9acd4067927..7e6728ea807 100644 --- a/include/llvm/CodeGen/DAGISelHeader.h +++ b/include/llvm/CodeGen/DAGISelHeader.h @@ -525,11 +525,10 @@ SDNode *SelectCodeCommon(SDNode *NodeToMatch, const unsigned char *MatcherTable, } case OPC_EmitRegister: { - unsigned RegNo = MatcherTable[MatcherIndex++]; MVT::SimpleValueType VT = - (MVT::SimpleValueType)MatcherTable[MatcherIndex++]; - SDValue Reg = CurDAG->getRegister(RegNo, VT); - RecordedNodes.push_back(N); + (MVT::SimpleValueType)MatcherTable[MatcherIndex++]; + unsigned RegNo = MatcherTable[MatcherIndex++]; + RecordedNodes.push_back(CurDAG->getRegister(RegNo, VT)); continue; } @@ -640,6 +639,8 @@ SDNode *SelectCodeCommon(SDNode *NodeToMatch, const unsigned char *MatcherTable, SmallVector VTs; for (unsigned i = 0; i != NumVTs; ++i) VTs.push_back((MVT::SimpleValueType)MatcherTable[MatcherIndex++]); + + // FIXME: Use faster version for the common 'one VT' case? SDVTList VTList = CurDAG->getVTList(VTs.data(), VTs.size()); // Get the operand list.