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

Dan Gohman gohman at apple.com
Wed Sep 24 18:28:51 PDT 2008


Author: djg
Date: Wed Sep 24 20:28:51 2008
New Revision: 56605

URL: http://llvm.org/viewvc/llvm-project?rev=56605&view=rev
Log:
Fix a recent fast-isel coverage regression - don't bail out before
giving the target a chance to materialize constants.

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=56605&r1=56604&r2=56605&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp Wed Sep 24 20:28:51 2008
@@ -75,16 +75,17 @@
   } else if (isa<UndefValue>(V)) {
     Reg = createResultReg(TLI.getRegClassFor(VT));
     BuildMI(MBB, TII.get(TargetInstrInfo::IMPLICIT_DEF), Reg);
-  } else {
-    return 0;
   }
   
+  // If target-independent code couldn't handle the value, give target-specific
+  // code a try.
   if (!Reg && isa<Constant>(V))
     Reg = TargetMaterializeConstant(cast<Constant>(V));
   
   // Don't cache constant materializations in the general ValueMap.
   // To do so would require tracking what uses they dominate.
-  LocalValueMap[V] = Reg;
+  if (Reg != 0)
+    LocalValueMap[V] = Reg;
   return Reg;
 }
 





More information about the llvm-commits mailing list