mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-11 13:46:13 +00:00
Evan pointed out that folding sext to zext may not be correct
if the zext is not legal. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50368 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
ebc3a3a3b2
commit
187db7b950
@ -2888,7 +2888,8 @@ SDOperand DAGCombiner::visitSIGN_EXTEND(SDNode *N) {
|
||||
}
|
||||
|
||||
// fold (sext x) -> (zext x) if the sign bit is known zero.
|
||||
if (DAG.SignBitIsZero(N0))
|
||||
if ((!AfterLegalize || TLI.isOperationLegal(ISD::ZERO_EXTEND, VT)) &&
|
||||
DAG.SignBitIsZero(N0))
|
||||
return DAG.getNode(ISD::ZERO_EXTEND, VT, N0);
|
||||
|
||||
return SDOperand();
|
||||
|
Loading…
Reference in New Issue
Block a user