Check for type legality before materializing integer constants in fast isel. With...
authorOwen Anderson <resistor@mac.com>
Tue, 9 Sep 2008 06:32:02 +0000 (06:32 +0000)
committerOwen Anderson <resistor@mac.com>
Tue, 9 Sep 2008 06:32:02 +0000 (06:32 +0000)
all of MultiSource/Applications passes on Darwin/X86 under FastISel.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55982 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/FastISel.cpp

index 33f4591b66a412df5b2b4963acf1442328293f23..d73bce74e6b005e9b54546de2129d15d1ca25b25 100644 (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),