mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-22 13:29:44 +00:00
Teach DAGCombine to convert (sext x) to (zext x) when the
sign-bit of x is known to be zero. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50357 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
beb4d8293d
commit
8f0ad582e8
@ -2887,6 +2887,10 @@ SDOperand DAGCombiner::visitSIGN_EXTEND(SDNode *N) {
|
|||||||
if (SCC.Val) return SCC;
|
if (SCC.Val) return SCC;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// fold (sext x) -> (zext x) if the sign bit is known zero.
|
||||||
|
if (DAG.SignBitIsZero(N0))
|
||||||
|
return DAG.getNode(ISD::ZERO_EXTEND, VT, N0);
|
||||||
|
|
||||||
return SDOperand();
|
return SDOperand();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user