[llvm-commits] [llvm] r55500 - /llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp

Dan Gohman gohman at apple.com
Thu Aug 28 14:19:08 PDT 2008


Author: djg
Date: Thu Aug 28 16:19:07 2008
New Revision: 55500

URL: http://llvm.org/viewvc/llvm-project?rev=55500&view=rev
Log:
Implement null and undef values for FastISel.

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=55500&r1=55499&r2=55500&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp Thu Aug 28 16:19:07 2008
@@ -31,6 +31,8 @@
     if (CI->getValue().getActiveBits() > 64)
       return 0;
     Reg = FastEmit_i(VT, VT, ISD::Constant, CI->getZExtValue());
+  } else if (isa<ConstantPointerNull>(V)) {
+    Reg = FastEmit_i(VT, VT, ISD::Constant, 0);
   } else if (ConstantFP *CF = dyn_cast<ConstantFP>(V)) {
     Reg = FastEmit_f(VT, VT, ISD::ConstantFP, CF);
 
@@ -53,6 +55,9 @@
       if (Reg == 0)
         return 0;
     }
+  } else if (isa<UndefValue>(V)) {
+    Reg = createResultReg(TLI.getRegClassFor(VT));
+    BuildMI(MBB, TII.get(TargetInstrInfo::IMPLICIT_DEF), Reg);
   }
 
   return Reg;





More information about the llvm-commits mailing list