mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-01 13:11:39 +01:00
Convert
// fold (sub c1, c2) -> c1-c2 from a no-op into an actual transformation. llvm-svn: 55886
This commit is contained in:
parent
9f540e75fd
commit
91e9abe370
@ -1111,7 +1111,7 @@ SDValue DAGCombiner::visitSUB(SDNode *N) {
|
||||
return DAG.getConstant(0, N->getValueType(0));
|
||||
// fold (sub c1, c2) -> c1-c2
|
||||
if (N0C && N1C)
|
||||
return DAG.getNode(ISD::SUB, VT, N0, N1);
|
||||
return DAG.getConstant(N0C->getAPIntValue() - N1C->getAPIntValue(), VT);
|
||||
// fold (sub x, c) -> (add x, -c)
|
||||
if (N1C)
|
||||
return DAG.getNode(ISD::ADD, VT, N0,
|
||||
|
Loading…
x
Reference in New Issue
Block a user