[llvm-commits] [llvm] r68546 - in /llvm/trunk: lib/CodeGen/SelectionDAG/FastISel.cpp test/CodeGen/X86/fast-isel-bail.ll

Dan Gohman gohman at apple.com
Tue Apr 7 13:40:11 PDT 2009


Author: djg
Date: Tue Apr  7 15:40:11 2009
New Revision: 68546

URL: http://llvm.org/viewvc/llvm-project?rev=68546&view=rev
Log:
Don't attempt to handle aggregate argument values in FastISel; let
SelectionDAG do those. This fixes PR3955.

Added:
    llvm/trunk/test/CodeGen/X86/fast-isel-bail.ll
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=68546&r1=68545&r2=68546&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp Tue Apr  7 15:40:11 2009
@@ -57,11 +57,15 @@
 using namespace llvm;
 
 unsigned FastISel::getRegForValue(Value *V) {
-  MVT::SimpleValueType VT = TLI.getValueType(V->getType()).getSimpleVT();
+  MVT RealVT = TLI.getValueType(V->getType(), /*AllowUnknown=*/true);
+  // Don't handle non-simple values in FastISel.
+  if (!RealVT.isSimple())
+    return 0;
 
   // Ignore illegal types. We must do this before looking up the value
   // in ValueMap because Arguments are given virtual registers regardless
   // of whether FastISel can handle them.
+  MVT::SimpleValueType VT = RealVT.getSimpleVT();
   if (!TLI.isTypeLegal(VT)) {
     // Promote MVT::i1 to a legal type though, because it's common and easy.
     if (VT == MVT::i1)

Added: llvm/trunk/test/CodeGen/X86/fast-isel-bail.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/fast-isel-bail.ll?rev=68546&view=auto

==============================================================================
--- llvm/trunk/test/CodeGen/X86/fast-isel-bail.ll (added)
+++ llvm/trunk/test/CodeGen/X86/fast-isel-bail.ll Tue Apr  7 15:40:11 2009
@@ -0,0 +1,14 @@
+; RUN: llvm-as < %s | llc -march=x86 -fast
+
+; This file is for regression tests for cases where FastISel needs
+; to gracefully bail out and let SelectionDAGISel take over.
+
+	type { i64, i8* }		; type %0
+
+declare void @bar(%0)
+
+define fastcc void @foo() nounwind {
+entry:
+	call void @bar(%0 zeroinitializer)
+	unreachable
+}





More information about the llvm-commits mailing list