mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-04-09 16:45:03 +00:00
Fold conditional branches on constants away.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19360 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
4287d5e355
commit
5351e9b172
@ -727,6 +727,12 @@ SDOperand SelectionDAG::getNode(unsigned Opcode, MVT::ValueType VT,
|
||||
}
|
||||
|
||||
break;
|
||||
case ISD::BRCOND:
|
||||
if (N2C)
|
||||
if (N2C->getValue()) // Unconditional branch
|
||||
return getNode(ISD::BR, MVT::Other, N1, N3);
|
||||
else
|
||||
return N1; // Never-taken branch
|
||||
}
|
||||
|
||||
SDNode *N = new SDNode(Opcode, N1, N2, N3);
|
||||
|
Loading…
x
Reference in New Issue
Block a user