diff options
author | Richard Osborne <richard@xmos.com> | 2008-11-17 17:34:31 +0000 |
---|---|---|
committer | Richard Osborne <richard@xmos.com> | 2008-11-17 17:34:31 +0000 |
commit | 6751b4a604ea3587cdd4d1e48d1205ec2a502873 (patch) | |
tree | e9a6d5f10068b94f2c57036748d45818ef28b763 /llvm/lib/CodeGen | |
parent | 20313c954edcfd8f391db707d2f3844eb6bb70f9 (diff) | |
download | bcm5719-llvm-6751b4a604ea3587cdd4d1e48d1205ec2a502873.tar.gz bcm5719-llvm-6751b4a604ea3587cdd4d1e48d1205ec2a502873.zip |
Don't produce ADDC/ADDE when expanding SHL unless they are legal
for the target. This fixes PR3080.
llvm-svn: 59450
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp index fb05f334c09..ddc339c324f 100644 --- a/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp @@ -1073,7 +1073,8 @@ void DAGTypeLegalizer::ExpandShiftByConstant(SDNode *N, unsigned Amt, } else if (Amt == NVTBits) { Lo = DAG.getConstant(0, NVT); Hi = InL; - } else if (Amt == 1) { + } else if (Amt == 1 && + TLI.isOperationLegal(ISD::ADDC, TLI.getTypeToExpandTo(NVT))) { // Emit this X << 1 as X+X. SDVTList VTList = DAG.getVTList(NVT, MVT::Flag); SDValue LoOps[2] = { InL, InL }; |