mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-10 04:33:40 +00:00
Legalize MERGE_VALUES, expand READCYCLECOUNTER correctly, so it doesn't
break control dependence. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24437 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
006e3e3649
commit
308575be66
@ -561,6 +561,8 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) {
|
|||||||
Result = DAG.getNode(Node->getOpcode(), Node->getValueType(0), Tmp1,
|
Result = DAG.getNode(Node->getOpcode(), Node->getValueType(0), Tmp1,
|
||||||
Node->getOperand(1));
|
Node->getOperand(1));
|
||||||
break;
|
break;
|
||||||
|
case ISD::MERGE_VALUES:
|
||||||
|
return LegalizeOp(Node->getOperand(Op.ResNo));
|
||||||
case ISD::CopyFromReg:
|
case ISD::CopyFromReg:
|
||||||
Tmp1 = LegalizeOp(Node->getOperand(0));
|
Tmp1 = LegalizeOp(Node->getOperand(0));
|
||||||
if (Tmp1 != Node->getOperand(0))
|
if (Tmp1 != Node->getOperand(0))
|
||||||
@ -3338,15 +3340,18 @@ void SelectionDAGLegalize::ExpandOp(SDOperand Op, SDOperand &Lo, SDOperand &Hi){
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case ISD::READCYCLECOUNTER:
|
case ISD::READCYCLECOUNTER: {
|
||||||
if (TLI.getOperationAction(ISD::READCYCLECOUNTER, VT) == TargetLowering::Custom) {
|
assert(TLI.getOperationAction(ISD::READCYCLECOUNTER, VT) ==
|
||||||
SDOperand Chain = LegalizeOp(Node->getOperand(0));
|
TargetLowering::Custom &&
|
||||||
AddLegalizedOperand(SDOperand(Node, 1), Chain);
|
"Must custom expand ReadCycleCounter");
|
||||||
SDOperand t = TLI.LowerOperation(Op, DAG);
|
SDOperand T = TLI.LowerOperation(Op, DAG);
|
||||||
ExpandOp(t, Lo, Hi);
|
assert(T.Val && "Node must be custom expanded!");
|
||||||
} else
|
Lo = LegalizeOp(T.getValue(0));
|
||||||
assert(0 && "Must custom expand ReadCycleCounter");
|
Hi = LegalizeOp(T.getValue(1));
|
||||||
|
AddLegalizedOperand(SDOperand(Node, 1), // Remember we legalized the chain.
|
||||||
|
LegalizeOp(T.getValue(2)));
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
// These operators cannot be expanded directly, emit them as calls to
|
// These operators cannot be expanded directly, emit them as calls to
|
||||||
// library functions.
|
// library functions.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user