mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-16 11:30:51 +00:00
Somewhat better solution.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48170 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
d2cde68855
commit
62fcc41d95
@ -1103,9 +1103,10 @@ SDOperand DAGCombiner::visitSUB(SDNode *N) {
|
||||
|
||||
// fold (sub x, x) -> 0
|
||||
if (N0 == N1) {
|
||||
if (ISD::isBuildVectorAllZeros(N0.Val))
|
||||
// Zero vectors might be normalized to a particular vector type to ensure
|
||||
// they are CSE'd. Return it as it is.
|
||||
if (!AfterLegalize || !MVT::isVector(VT))
|
||||
// For example, zero vectors might be normalized to a particular vector
|
||||
// type to ensure they are CSE'd. Avoid issuing zero vector nodes of
|
||||
// *unexpected* type after legalization.
|
||||
return N0;
|
||||
return DAG.getConstant(0, N->getValueType(0));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user