Fix preselection/lowerswitches bug
llvm-svn: 9333
diff --git a/llvm/lib/Target/Sparc/SparcInstrInfo.cpp b/llvm/lib/Target/Sparc/SparcInstrInfo.cpp
index 0a3ccc8..2d87231 100644
--- a/llvm/lib/Target/Sparc/SparcInstrInfo.cpp
+++ b/llvm/lib/Target/Sparc/SparcInstrInfo.cpp
@@ -431,6 +431,9 @@
if (isa<ConstantPointerNull>(CV)) // can always use %g0
return false;
+ if (isa<SwitchInst>(I)) // Switch instructions will be lowered!
+ return false;
+
if (const ConstantInt* CI = dyn_cast<ConstantInt>(CV))
return labs((int64_t)CI->getRawValue()) > MaxConstantsTable[I->getOpcode()];