mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-17 21:29:20 +00:00
More fixes for Selection of copyto/fromreg with a flag
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24829 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f1a47c3371
commit
dc464de9b0
@ -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
Block a user