mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-27 05:32:22 +00:00
Canonicalize ladd constant to RHS.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98058 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
7b871b3464
commit
78717cd804
@ -1105,6 +1105,10 @@ SDValue XCoreTargetLowering::PerformDAGCombine(SDNode *N,
|
||||
ConstantSDNode *N1C = dyn_cast<ConstantSDNode>(N1);
|
||||
EVT VT = N0.getValueType();
|
||||
|
||||
// canonicalize constant to RHS
|
||||
if (N0C && !N1C)
|
||||
return DAG.getNode(XCoreISD::LADD, dl, DAG.getVTList(VT, VT), N1, N0, N2);
|
||||
|
||||
// fold (ladd 0, 0, x) -> 0, x & 1
|
||||
if (N0C && N0C->isNullValue() && N1C && N1C->isNullValue()) {
|
||||
SDValue Carry = DAG.getConstant(0, VT);
|
||||
|
Loading…
x
Reference in New Issue
Block a user