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 | f037f87bdeff21a215634102e817bd38fe286459 (patch) | |
tree | 42fc7b2a4dcc60c73cb39975ad6a2e6bc78d86dc /llvm/lib/CodeGen | |
parent | a425392cdfc9dcb290b97806b603807d53361e8d (diff) | |
download | bcm5719-llvm-f037f87bdeff21a215634102e817bd38fe286459.tar.gz bcm5719-llvm-f037f87bdeff21a215634102e817bd38fe286459.zip |
(i32 sext_in_reg (i32 aext (i16 x)), i16) -> (i32 sext x). No known test case until -promote-16bit is enabled.
llvm-svn: 101551
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 5c53a7f6bd1..9ba9bb5e38d 100644 --- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/llvm/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); } |