mirror of
https://github.com/RPCSX/llvm.git
synced 2025-01-07 12:30:44 +00:00
Only transform (sext (truncate x)) -> (sextinreg x) if before legalize or
if the target supports the resultant sextinreg git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24632 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
e80242a948
commit
cc2210b4fa
@ -1547,7 +1547,9 @@ SDOperand DAGCombiner::visitSIGN_EXTEND(SDNode *N) {
|
||||
if (N0.getOpcode() == ISD::SEXTLOAD && VT == N0.getValueType())
|
||||
return N0;
|
||||
// fold (sext (truncate x)) -> (sextinreg x) iff x size == sext size.
|
||||
if (N0.getOpcode() == ISD::TRUNCATE && N0.getOperand(0).getValueType() == VT)
|
||||
if (N0.getOpcode() == ISD::TRUNCATE && N0.getOperand(0).getValueType() == VT&&
|
||||
(!AfterLegalize ||
|
||||
TLI.isOperationLegal(ISD::SIGN_EXTEND_INREG, N0.getValueType())))
|
||||
return DAG.getNode(ISD::SIGN_EXTEND_INREG, VT, N0.getOperand(0),
|
||||
DAG.getValueType(N0.getValueType()));
|
||||
// fold (sext (load x)) -> (sextload x)
|
||||
|
Loading…
Reference in New Issue
Block a user