Fix preselection/lowerswitches bug

llvm-svn: 9333
This commit is contained in:
Chris Lattner 2003-10-21 16:29:23 +00:00
parent 4439aee504
commit a62228d01a
1 changed files with 3 additions and 0 deletions

View 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()];