diff options
| author | Evan Cheng <evan.cheng@apple.com> | 2010-04-16 22:26:19 +0000 |
|---|---|---|
| committer | Evan Cheng <evan.cheng@apple.com> | 2010-04-16 22:26:19 +0000 |
| commit | a475cffeb463990d6e0c7eca6460da78428c233c (patch) | |
| tree | f4f74fdb5878a1230ce8884f4d4dc588f03fcfb4 /lib/CodeGen | |
| parent | 21e54d8ac83a0f1b8badd7c8878830bfbe997036 (diff) | |
| download | external_llvm-a475cffeb463990d6e0c7eca6460da78428c233c.zip external_llvm-a475cffeb463990d6e0c7eca6460da78428c233c.tar.gz external_llvm-a475cffeb463990d6e0c7eca6460da78428c233c.tar.bz2 | |
(i32 sext_in_reg (i32 aext (i16 x)), i16) -> (i32 sext x). No known test case until -promote-16bit is enabled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101551 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
| -rw-r--r-- | lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 5c53a7f..9ba9bb5 100644 --- a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -3748,7 +3748,8 @@ SDValue DAGCombiner::visitSIGN_EXTEND_INREG(SDNode *N) { // if x is small enough. if (N0.getOpcode() == ISD::SIGN_EXTEND || N0.getOpcode() == ISD::ANY_EXTEND) { SDValue N00 = N0.getOperand(0); - if (N00.getValueType().getScalarType().getSizeInBits() < EVTBits) + if (N00.getValueType().getScalarType().getSizeInBits() <= EVTBits && + (!LegalOperations || TLI.isOperationLegal(ISD::SIGN_EXTEND, VT))) return DAG.getNode(ISD::SIGN_EXTEND, N->getDebugLoc(), VT, N00, N1); } |
