mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-15 06:29:05 +00:00
Doh
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48140 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1102,12 +1102,13 @@ SDOperand DAGCombiner::visitSUB(SDNode *N) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// fold (sub x, x) -> 0
|
// fold (sub x, x) -> 0
|
||||||
if (N0 == N1)
|
if (N0 == N1) {
|
||||||
if (ISD::isBuildVectorAllZeros(N0.Val))
|
if (ISD::isBuildVectorAllZeros(N0.Val))
|
||||||
// Zero vectors might be normalized to a particular vector type to ensure
|
// Zero vectors might be normalized to a particular vector type to ensure
|
||||||
// they are CSE'd. Return it as it is.
|
// they are CSE'd. Return it as it is.
|
||||||
return N0;
|
return N0;
|
||||||
return DAG.getConstant(0, N->getValueType(0));
|
return DAG.getConstant(0, N->getValueType(0));
|
||||||
|
}
|
||||||
// fold (sub c1, c2) -> c1-c2
|
// fold (sub c1, c2) -> c1-c2
|
||||||
if (N0C && N1C)
|
if (N0C && N1C)
|
||||||
return DAG.getNode(ISD::SUB, VT, N0, N1);
|
return DAG.getNode(ISD::SUB, VT, N0, N1);
|
||||||
|
Reference in New Issue
Block a user