Fix preselection/lowerswitches bug
authorChris Lattner <sabre@nondot.org>
Tue, 21 Oct 2003 16:29:23 +0000 (16:29 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 21 Oct 2003 16:29:23 +0000 (16:29 +0000)
llvm-svn: 9333

llvm/lib/Target/Sparc/SparcInstrInfo.cpp

index 0a3ccc8..2d87231 100644 (file)
@@ -431,6 +431,9 @@ UltraSparcInstrInfo::ConstantMayNotFitInImmedField(const Constant* CV,
   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()];