[llvm-commits] [llvm] r41712 - in /llvm/trunk: lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp test/CodeGen/X86/2007-09-03-X86-64-EhSelector.ll

Evan Cheng evan.cheng at apple.com
Tue Sep 4 13:39:26 PDT 2007


Author: evancheng
Date: Tue Sep  4 15:39:26 2007
New Revision: 41712

URL: http://llvm.org/viewvc/llvm-project?rev=41712&view=rev
Log:
Fix for PR1632. EHSELECTION always produces a i32 value.

Added:
    llvm/trunk/test/CodeGen/X86/2007-09-03-X86-64-EhSelector.ll
Modified:
    llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=41712&r1=41711&r2=41712&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Tue Sep  4 15:39:26 2007
@@ -2703,7 +2703,7 @@
       }
 
       // Insert the EHSELECTION instruction.
-      SDVTList VTs = DAG.getVTList(TLI.getPointerTy(), MVT::Other);
+      SDVTList VTs = DAG.getVTList(MVT::i32, MVT::Other);
       SDOperand Ops[2];
       Ops[0] = getValue(I.getOperand(1));
       Ops[1] = getRoot();

Added: llvm/trunk/test/CodeGen/X86/2007-09-03-X86-64-EhSelector.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2007-09-03-X86-64-EhSelector.ll?rev=41712&view=auto

==============================================================================
--- llvm/trunk/test/CodeGen/X86/2007-09-03-X86-64-EhSelector.ll (added)
+++ llvm/trunk/test/CodeGen/X86/2007-09-03-X86-64-EhSelector.ll Tue Sep  4 15:39:26 2007
@@ -0,0 +1,38 @@
+; RUN: llvm-as < %s | llc -march=x86-64 -enable-eh
+; PR1632
+
+define void @_Z1fv() {
+entry:
+	invoke void @_Z1gv( )
+			to label %return unwind label %unwind
+
+unwind:		; preds = %entry
+	br i1 false, label %eh_then, label %cleanup20
+
+eh_then:		; preds = %unwind
+	invoke void @__cxa_end_catch( )
+			to label %return unwind label %unwind10
+
+unwind10:		; preds = %eh_then
+	%eh_select13 = tail call i32 (i8*, i8*, ...)* @llvm.eh.selector( i8* null, i8* bitcast (void ()* @__gxx_personality_v0 to i8*), i32 1 )		; <i32> [#uses=2]
+	%tmp18 = icmp slt i32 %eh_select13, 0		; <i1> [#uses=1]
+	br i1 %tmp18, label %filter, label %cleanup20
+
+filter:		; preds = %unwind10
+	unreachable
+
+cleanup20:		; preds = %unwind10, %unwind
+	%eh_selector.0 = phi i32 [ 0, %unwind ], [ %eh_select13, %unwind10 ]		; <i32> [#uses=0]
+	ret void
+
+return:		; preds = %eh_then, %entry
+	ret void
+}
+
+declare void @_Z1gv()
+
+declare i32 @llvm.eh.selector(i8*, i8*, ...)
+
+declare void @__gxx_personality_v0()
+
+declare void @__cxa_end_catch()





More information about the llvm-commits mailing list