[llvm-commits] [llvm] r56009 -	/llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp
    Owen Anderson 
    resistor at mac.com
       
    Tue Sep  9 13:47:17 PDT 2008
    
    
  
Author: resistor
Date: Tue Sep  9 15:47:17 2008
New Revision: 56009
URL: http://llvm.org/viewvc/llvm-project?rev=56009&view=rev
Log:
Clean this up, based on Evan's suggestions.
Modified:
    llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp?rev=56009&r1=56008&r2=56009&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp Tue Sep  9 15:47:17 2008
@@ -33,14 +33,14 @@
     return Reg;
 
   MVT::SimpleValueType VT = TLI.getValueType(V->getType()).getSimpleVT();
+  if (!TLI.isTypeLegal(VT))
+    return 0;
   if (ConstantInt *CI = dyn_cast<ConstantInt>(V)) {
     if (CI->getValue().getActiveBits() > 64)
       return TargetMaterializeConstant(CI,
                                        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),
    
    
More information about the llvm-commits
mailing list