forked from OSchip/llvm-project
More fixes for Selection of copyto/fromreg with a flag
llvm-svn: 24829
This commit is contained in:
parent
ebcfa0c210
commit
abb11cc83e
llvm/utils/TableGen
|
@ -2353,7 +2353,7 @@ void DAGISelEmitter::EmitInstructionSelector(std::ostream &OS) {
|
|||
<< " SDOperand Chain = Select(N.getOperand(0));\n"
|
||||
<< " unsigned Reg = cast<RegisterSDNode>(N.getOperand(1))->getReg();\n"
|
||||
<< " MVT::ValueType VT = N.Val->getValueType(0);\n"
|
||||
<< " if (N.getNumOperands() == 2) {\n"
|
||||
<< " if (N.Val->getNumValues() == 2) {\n"
|
||||
<< " if (Chain == N.getOperand(0)) return N; // No change\n"
|
||||
<< " SDOperand New = CurDAG->getCopyFromReg(Chain, Reg, VT);\n"
|
||||
<< " CodeGenMap[N.getValue(0)] = New;\n"
|
||||
|
@ -2361,8 +2361,9 @@ void DAGISelEmitter::EmitInstructionSelector(std::ostream &OS) {
|
|||
<< " return New.getValue(N.ResNo);\n"
|
||||
<< " } else {\n"
|
||||
<< " SDOperand Flag;\n"
|
||||
<< " if (N.getOperand(2).Val) Flag = Select(N.getOperand(2));\n"
|
||||
<< " if (Chain == N.getOperand(0) && Flag == N.getOperand(2))\n"
|
||||
<< " if (N.getNumOperands() == 3) Flag = Select(N.getOperand(2));\n"
|
||||
<< " if (Chain == N.getOperand(0) &&\n"
|
||||
<< " (N.getNumOperands() == 2 || Flag == N.getOperand(2)))\n"
|
||||
<< " return N; // No change\n"
|
||||
<< " SDOperand New = CurDAG->getCopyFromReg(Chain, Reg, VT, Flag);\n"
|
||||
<< " CodeGenMap[N.getValue(0)] = New;\n"
|
||||
|
@ -2373,21 +2374,19 @@ void DAGISelEmitter::EmitInstructionSelector(std::ostream &OS) {
|
|||
<< " }\n"
|
||||
<< " case ISD::CopyToReg: {\n"
|
||||
<< " SDOperand Chain = Select(N.getOperand(0));\n"
|
||||
<< " SDOperand Reg = N.getOperand(1);\n"
|
||||
<< " unsigned Reg = cast<RegisterSDNode>(N.getOperand(1))->getReg();\n"
|
||||
<< " SDOperand Val = Select(N.getOperand(2));\n"
|
||||
<< " SDOperand Result = N;\n"
|
||||
<< " if (N.getNumOperands() == 3) {\n"
|
||||
<< " if (N.Val->getNumValues() == 1) {\n"
|
||||
<< " if (Chain != N.getOperand(0) || Val != N.getOperand(2))\n"
|
||||
<< " Result = CurDAG->getNode(ISD::CopyToReg, MVT::Other,\n"
|
||||
<< " Chain, Reg, Val);\n"
|
||||
<< " Result = CurDAG->getCopyToReg(Chain, Reg, Val);\n"
|
||||
<< " return CodeGenMap[N] = Result;\n"
|
||||
<< " } else {\n"
|
||||
<< " SDOperand Flag;\n"
|
||||
<< " if (N.getOperand(3).Val) Flag = Select(N.getOperand(3));\n"
|
||||
<< " if (N.getNumOperands() == 4) Flag = Select(N.getOperand(3));\n"
|
||||
<< " if (Chain != N.getOperand(0) || Val != N.getOperand(2) ||\n"
|
||||
<< " Flag != N.getOperand(3))\n"
|
||||
<< " Result = CurDAG->getNode(ISD::CopyToReg, MVT::Other,\n"
|
||||
<< " Chain, Reg, Val, Flag);\n"
|
||||
<< " (N.getNumOperands() == 4 && Flag != N.getOperand(3)))\n"
|
||||
<< " Result = CurDAG->getCopyToReg(Chain, Reg, Val, Flag);\n"
|
||||
<< " CodeGenMap[N.getValue(0)] = Result;\n"
|
||||
<< " CodeGenMap[N.getValue(1)] = Result.getValue(1);\n"
|
||||
<< " return Result.getValue(N.ResNo);\n"
|
||||
|
|
Loading…
Reference in New Issue