mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-22 13:29:44 +00:00
Add an assertion, avoid some unneeded work for each call. No functionality
change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28347 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
9a2a497284
commit
b248e16afd
@ -820,13 +820,15 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) {
|
|||||||
case ISD::FORMAL_ARGUMENTS:
|
case ISD::FORMAL_ARGUMENTS:
|
||||||
case ISD::CALL:
|
case ISD::CALL:
|
||||||
// The only option for this is to custom lower it.
|
// The only option for this is to custom lower it.
|
||||||
Result = TLI.LowerOperation(Result.getValue(0), DAG);
|
Tmp3 = TLI.LowerOperation(Result.getValue(0), DAG);
|
||||||
assert(Result.Val && "Target didn't custom lower this node!");
|
assert(Tmp3.Val && "Target didn't custom lower this node!");
|
||||||
|
assert(Tmp3.Val->getNumValues() == Result.Val->getNumValues() &&
|
||||||
|
"Lowering call/formal_arguments produced unexpected # results!");
|
||||||
|
|
||||||
// Since CALL/FORMAL_ARGUMENTS nodes produce multiple values, make sure to
|
// Since CALL/FORMAL_ARGUMENTS nodes produce multiple values, make sure to
|
||||||
// remember that we legalized all of them, so it doesn't get relegalized.
|
// remember that we legalized all of them, so it doesn't get relegalized.
|
||||||
for (unsigned i = 0, e = Result.Val->getNumValues(); i != e; ++i) {
|
for (unsigned i = 0, e = Tmp3.Val->getNumValues(); i != e; ++i) {
|
||||||
Tmp1 = LegalizeOp(Result.getValue(i));
|
Tmp1 = LegalizeOp(Tmp3.getValue(i));
|
||||||
if (Op.ResNo == i)
|
if (Op.ResNo == i)
|
||||||
Tmp2 = Tmp1;
|
Tmp2 = Tmp1;
|
||||||
AddLegalizedOperand(SDOperand(Node, i), Tmp1);
|
AddLegalizedOperand(SDOperand(Node, i), Tmp1);
|
||||||
@ -1056,8 +1058,10 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) {
|
|||||||
|
|
||||||
// Merge in the last call, to ensure that this call start after the last
|
// Merge in the last call, to ensure that this call start after the last
|
||||||
// call ended.
|
// call ended.
|
||||||
Tmp1 = DAG.getNode(ISD::TokenFactor, MVT::Other, Tmp1, LastCALLSEQ_END);
|
if (LastCALLSEQ_END.getOpcode() != ISD::EntryNode) {
|
||||||
Tmp1 = LegalizeOp(Tmp1);
|
Tmp1 = DAG.getNode(ISD::TokenFactor, MVT::Other, Tmp1, LastCALLSEQ_END);
|
||||||
|
Tmp1 = LegalizeOp(Tmp1);
|
||||||
|
}
|
||||||
|
|
||||||
// Do not try to legalize the target-specific arguments (#1+).
|
// Do not try to legalize the target-specific arguments (#1+).
|
||||||
if (Tmp1 != Node->getOperand(0)) {
|
if (Tmp1 != Node->getOperand(0)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user