[llvm-commits] [llvm] r66193 - in /llvm/branches/Apple/Dib: lib/Transforms/Scalar/CodeGenPrepare.cpp test/CodeGen/X86/split-eh-lpad-edges.ll

Bill Wendling isanbard at gmail.com
Thu Mar 5 12:45:19 PST 2009


Author: void
Date: Thu Mar  5 14:45:18 2009
New Revision: 66193

URL: http://llvm.org/viewvc/llvm-project?rev=66193&view=rev
Log:
--- Merging (from foreign repository) r66140 into '.':
A    test/CodeGen/X86/split-eh-lpad-edges.ll
U    lib/Transforms/Scalar/CodeGenPrepare.cpp

Do not split edges to EH landing pads. It will cause code size explosion.

Added:
    llvm/branches/Apple/Dib/test/CodeGen/X86/split-eh-lpad-edges.ll
Modified:
    llvm/branches/Apple/Dib/lib/Transforms/Scalar/CodeGenPrepare.cpp

Modified: llvm/branches/Apple/Dib/lib/Transforms/Scalar/CodeGenPrepare.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Transforms/Scalar/CodeGenPrepare.cpp?rev=66193&r1=66192&r2=66193&view=diff

==============================================================================
--- llvm/branches/Apple/Dib/lib/Transforms/Scalar/CodeGenPrepare.cpp (original)
+++ llvm/branches/Apple/Dib/lib/Transforms/Scalar/CodeGenPrepare.cpp Thu Mar  5 14:45:18 2009
@@ -326,6 +326,12 @@
   assert(isa<PHINode>(Dest->begin()) &&
          "This should only be called if Dest has a PHI!");
 
+  // Do not split edges to EH landing pads.
+  if (InvokeInst *Invoke = dyn_cast<InvokeInst>(TI)) {
+    if (Invoke->getSuccessor(1) == Dest)
+      return;
+  }
+
   // As a hack, never split backedges of loops.  Even though the copy for any
   // PHIs inserted on the backedge would be dead for exits from the loop, we
   // assume that the cost of *splitting* the backedge would be too high.

Added: llvm/branches/Apple/Dib/test/CodeGen/X86/split-eh-lpad-edges.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/test/CodeGen/X86/split-eh-lpad-edges.ll?rev=66193&view=auto

==============================================================================
--- llvm/branches/Apple/Dib/test/CodeGen/X86/split-eh-lpad-edges.ll (added)
+++ llvm/branches/Apple/Dib/test/CodeGen/X86/split-eh-lpad-edges.ll Thu Mar  5 14:45:18 2009
@@ -0,0 +1,34 @@
+; RUN: llvm-as < %s | llc -mtriple=x86_64-apple-darwin | not grep jmp
+; rdar://6647639
+
+	%struct.FetchPlanHeader = type { i8*, i8*, i32, i8*, i8*, i8*, i8*, i8*, %struct.NSObject* (%struct.NSObject*, %struct.objc_selector*, ...)*, %struct.__attributeDescriptionFlags }
+	%struct.NSArray = type { %struct.NSObject }
+	%struct.NSAutoreleasePool = type { %struct.NSObject, i8*, i8*, i8*, i8* }
+	%struct.NSObject = type { %struct.NSObject* }
+	%struct.__attributeDescriptionFlags = type <{ i32 }>
+	%struct._message_ref_t = type { %struct.NSObject* (%struct.NSObject*, %struct._message_ref_t*, ...)*, %struct.objc_selector* }
+	%struct.objc_selector = type opaque
+@"\01l_objc_msgSend_fixup_alloc" = external global %struct._message_ref_t, align 16		; <%struct._message_ref_t*> [#uses=2]
+
+define %struct.NSArray* @newFetchedRowsForFetchPlan_MT(%struct.FetchPlanHeader* %fetchPlan, %struct.objc_selector* %selectionMethod, %struct.NSObject* %selectionParameter) ssp {
+entry:
+	%0 = invoke %struct.NSObject* null(%struct.NSObject* null, %struct._message_ref_t* @"\01l_objc_msgSend_fixup_alloc")
+			to label %invcont unwind label %lpad		; <%struct.NSObject*> [#uses=1]
+
+invcont:		; preds = %entry
+	%1 = invoke %struct.NSObject* (%struct.NSObject*, %struct.objc_selector*, ...)* @objc_msgSend(%struct.NSObject* %0, %struct.objc_selector* null)
+			to label %invcont26 unwind label %lpad		; <%struct.NSObject*> [#uses=0]
+
+invcont26:		; preds = %invcont
+	%2 = invoke %struct.NSObject* null(%struct.NSObject* null, %struct._message_ref_t* @"\01l_objc_msgSend_fixup_alloc")
+			to label %invcont27 unwind label %lpad		; <%struct.NSObject*> [#uses=0]
+
+invcont27:		; preds = %invcont26
+	unreachable
+
+lpad:		; preds = %invcont26, %invcont, %entry
+	%pool.1 = phi %struct.NSAutoreleasePool* [ null, %entry ], [ null, %invcont ], [ null, %invcont26 ]		; <%struct.NSAutoreleasePool*> [#uses=0]
+	unreachable
+}
+
+declare %struct.NSObject* @objc_msgSend(%struct.NSObject*, %struct.objc_selector*, ...)





More information about the llvm-commits mailing list