Check for type legality before materializing integer constants in fast isel. With this change,

all of MultiSource/Applications passes on Darwin/X86 under FastISel.

llvm-svn: 55982
This commit is contained in:
Owen Anderson 2008-09-09 06:32:02 +00:00
parent 7aedcf151c
commit 8529085f4f
1 changed files with 2 additions and 0 deletions

View File

@ -39,6 +39,8 @@ unsigned FastISel::getRegForValue(Value *V) {
MBB->getParent()->getConstantPool());
// Don't cache constant materializations. To do so would require
// tracking what uses they dominate.
if (!TLI.isTypeLegal(VT))
return false;
Reg = FastEmit_i(VT, VT, ISD::Constant, CI->getZExtValue());
} else if (isa<GlobalValue>(V)) {
return TargetMaterializeConstant(dyn_cast<Constant>(V),