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)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9333 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/SparcV9/SparcV9InstrInfo.cpp

index 0a3ccc84e837b88dced8a126bc00cb24afb9801c..2d872314e9a3a6c018b1c1e52b7abb204f0e976a 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()];