aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/SelectionDAG
diff options
context:
space:
mode:
authorAnton Korobeynikov <asl@math.spbu.ru>2009-05-08 18:51:34 +0000
committerAnton Korobeynikov <asl@math.spbu.ru>2009-05-08 18:51:34 +0000
commitd34167a4abbe576bef7dbe1b88771f09afc82a72 (patch)
tree8221313800633abe7deed8d5b39e331ccd2a645b /lib/CodeGen/SelectionDAG
parentda4d2f63d8b138569ec732d970bb452a0403a3ab (diff)
downloadexternal_llvm-d34167a4abbe576bef7dbe1b88771f09afc82a72.tar.gz
external_llvm-d34167a4abbe576bef7dbe1b88771f09afc82a72.tar.bz2
external_llvm-d34167a4abbe576bef7dbe1b88771f09afc82a72.zip
Do not emit bit tests if target does not support natively left shift
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71240 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG')
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
index fd89108392..d0fd6b4f64 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
@@ -1923,6 +1923,10 @@ bool SelectionDAGLowering::handleBitTestsSwitchCase(CaseRec& CR,
// inserting any additional MBBs necessary to represent the switch.
MachineFunction *CurMF = CurMBB->getParent();
+ // If target does not have legal shift left, do not emit bit tests at all.
+ if (!TLI.isOperationLegal(ISD::SHL, TLI.getPointerTy()))
+ return false;
+
size_t numCmps = 0;
for (CaseItr I = CR.Range.first, E = CR.Range.second;
I!=E; ++I) {