mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-20 19:42:54 +02:00
Fold trunc(any_ext). This gives stuff like:
27,28c27 < movzwl %di, %edi < movl %edi, %ebx --- > movw %di, %bx llvm-svn: 28137
This commit is contained in:
parent
c912cf0b07
commit
32e96402c0
@ -2005,7 +2005,8 @@ SDOperand DAGCombiner::visitTRUNCATE(SDNode *N) {
|
||||
if (N0.getOpcode() == ISD::TRUNCATE)
|
||||
return DAG.getNode(ISD::TRUNCATE, VT, N0.getOperand(0));
|
||||
// fold (truncate (ext x)) -> (ext x) or (truncate x) or x
|
||||
if (N0.getOpcode() == ISD::ZERO_EXTEND || N0.getOpcode() == ISD::SIGN_EXTEND){
|
||||
if (N0.getOpcode() == ISD::ZERO_EXTEND || N0.getOpcode() == ISD::SIGN_EXTEND||
|
||||
N0.getOpcode() == ISD::ANY_EXTEND) {
|
||||
if (N0.getValueType() < VT)
|
||||
// if the source is smaller than the dest, we still need an extend
|
||||
return DAG.getNode(N0.getOpcode(), VT, N0.getOperand(0));
|
||||
|
Loading…
Reference in New Issue
Block a user