[llvm-commits] [llvm] r132885 - in /llvm/trunk: lib/CodeGen/AsmPrinter/AsmPrinter.cpp test/CodeGen/X86/asm-label.ll test/CodeGen/X86/asm-label2.ll

Rafael Espindola rafael.espindola at gmail.com
Sat Jun 11 22:57:01 PDT 2011


Author: rafael
Date: Sun Jun 12 00:57:01 2011
New Revision: 132885

URL: http://llvm.org/viewvc/llvm-project?rev=132885&view=rev
Log:
Really fix the fall-through logic.
Add a triple to the tests.

Added:
    llvm/trunk/test/CodeGen/X86/asm-label2.ll
Modified:
    llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
    llvm/trunk/test/CodeGen/X86/asm-label.ll

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=132885&r1=132884&r2=132885&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Sun Jun 12 00:57:01 2011
@@ -1941,6 +1941,9 @@
   if (TII->AnalyzeBranch(*Pred, PredTBB, PredFBB, PredCond))
     return false;
 
+  if (PredTBB == MBB || PredFBB == MBB)
+    return false;
+
   // This is a fall through if there is no conditions in the bb
   // or if there is no explicit false branch.
   return PredCond.empty() || !PredFBB;

Modified: llvm/trunk/test/CodeGen/X86/asm-label.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/asm-label.ll?rev=132885&r1=132884&r2=132885&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/asm-label.ll (original)
+++ llvm/trunk/test/CodeGen/X86/asm-label.ll Sun Jun 12 00:57:01 2011
@@ -1,4 +1,4 @@
-; RUN: llc -O0 < %s | FileCheck %s
+; RUN: llc -mtriple=x86_64-apple-darwin10 -O0 < %s | FileCheck %s
 
 ; test that we print a label that we use. We had a bug where
 ; we would print the jump, but not the label because it was considered

Added: llvm/trunk/test/CodeGen/X86/asm-label2.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/asm-label2.ll?rev=132885&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/X86/asm-label2.ll (added)
+++ llvm/trunk/test/CodeGen/X86/asm-label2.ll Sun Jun 12 00:57:01 2011
@@ -0,0 +1,22 @@
+; RUN: llc -mtriple=x86_64-apple-darwin10 -O0 < %s | FileCheck %s
+
+; test that we print a label that we use. We had a bug where
+; we would print the jump, but not the label because it was considered
+; a fall through.
+
+; CHECK:        jmp     LBB0_1
+; CHECK: LBB0_1:
+
+define void @foobar()  {
+entry:
+  invoke void @_zed()
+          to label %invoke.cont unwind label %lpad
+
+invoke.cont:                                      ; preds = %entry
+  ret void
+
+lpad:                                             ; preds = %entry
+  unreachable
+}
+
+declare void @_zed() ssp align 2





More information about the llvm-commits mailing list