[llvm] r276898 - Revert EH-specific checks in BranchFolding that were causing blow ups in compile time.

Andrew Kaylor via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 27 10:55:34 PDT 2016


Author: akaylor
Date: Wed Jul 27 12:55:33 2016
New Revision: 276898

URL: http://llvm.org/viewvc/llvm-project?rev=276898&view=rev
Log:
Revert EH-specific checks in BranchFolding that were causing blow ups in compile time.

Differential Revision: https://reviews.llvm.org/D22839


Modified:
    llvm/trunk/lib/CodeGen/BranchFolding.cpp
    llvm/trunk/test/CodeGen/WinEH/wineh-noret-cleanup.ll
    llvm/trunk/test/CodeGen/X86/wineh-coreclr.ll

Modified: llvm/trunk/lib/CodeGen/BranchFolding.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/BranchFolding.cpp?rev=276898&r1=276897&r2=276898&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/BranchFolding.cpp (original)
+++ llvm/trunk/lib/CodeGen/BranchFolding.cpp Wed Jul 27 12:55:33 2016
@@ -1595,14 +1595,6 @@ ReoptimizeBlock:
       // removed, move this block to the end of the function.
       MachineBasicBlock *PrevTBB = nullptr, *PrevFBB = nullptr;
       SmallVector<MachineOperand, 4> PrevCond;
-      // We're looking for cases where PrevBB could possibly fall through to
-      // FallThrough, but if FallThrough is an EH pad that wouldn't be useful
-      // so here we skip over any EH pads so we might have a chance to find
-      // a branch target from PrevBB.
-      while (FallThrough != MF.end() && FallThrough->isEHPad())
-        ++FallThrough;
-      // Now check to see if the current block is sitting between PrevBB and
-      // a block to which it could fall through.
       if (FallThrough != MF.end() &&
           !TII->analyzeBranch(PrevBB, PrevTBB, PrevFBB, PrevCond, true) &&
           PrevBB.isSuccessor(&*FallThrough)) {

Modified: llvm/trunk/test/CodeGen/WinEH/wineh-noret-cleanup.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/WinEH/wineh-noret-cleanup.ll?rev=276898&r1=276897&r2=276898&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/WinEH/wineh-noret-cleanup.ll (original)
+++ llvm/trunk/test/CodeGen/WinEH/wineh-noret-cleanup.ll Wed Jul 27 12:55:33 2016
@@ -50,13 +50,13 @@ catch.body.2:
 ; CXX-NEXT:   .long   1
 ; CXX-NEXT:   .long   .Ltmp1 at IMGREL+1
 ; CXX-NEXT:   .long   -1
-; CXX-NEXT:   .long   "?catch$3@?0?test at 4HA"@IMGREL
+; CXX-NEXT:   .long   "?catch$2@?0?test at 4HA"@IMGREL
 ; CXX-NEXT:   .long   2
 ; CXX-NEXT:   .long   .Ltmp2 at IMGREL+1
 ; CXX-NEXT:   .long   3
 ; CXX-NEXT:   .long   .Ltmp3 at IMGREL+1
 ; CXX-NEXT:   .long   2
-; CXX-NEXT:   .long   "?catch$5@?0?test at 4HA"@IMGREL
+; CXX-NEXT:   .long   "?catch$4@?0?test at 4HA"@IMGREL
 ; CXX-NEXT:   .long   4
 
 ; SEH-LABEL: test:
@@ -64,17 +64,17 @@ catch.body.2:
 ; SEH-NEXT:    .long   .Ltmp0 at IMGREL+1
 ; SEH-NEXT:    .long   .Ltmp1 at IMGREL+1
 ; SEH-NEXT:    .long   dummy_filter at IMGREL
-; SEH-NEXT:    .long   .LBB0_3 at IMGREL
+; SEH-NEXT:    .long   .LBB0_2 at IMGREL
 ; SEH-NEXT:    .long   .Ltmp0 at IMGREL+1
 ; SEH-NEXT:    .long   .Ltmp1 at IMGREL+1
 ; SEH-NEXT:    .long   dummy_filter at IMGREL
-; SEH-NEXT:    .long   .LBB0_5 at IMGREL
+; SEH-NEXT:    .long   .LBB0_4 at IMGREL
 ; SEH-NEXT:    .long   .Ltmp2 at IMGREL+1
 ; SEH-NEXT:    .long   .Ltmp3 at IMGREL+1
-; SEH-NEXT:    .long   "?dtor$2@?0?test at 4HA"@IMGREL
+; SEH-NEXT:    .long   "?dtor$5@?0?test at 4HA"@IMGREL
 ; SEH-NEXT:    .long   0
 ; SEH-NEXT:    .long   .Ltmp2 at IMGREL+1
 ; SEH-NEXT:    .long   .Ltmp3 at IMGREL+1
 ; SEH-NEXT:    .long   dummy_filter at IMGREL
-; SEH-NEXT:    .long   .LBB0_5 at IMGREL
+; SEH-NEXT:    .long   .LBB0_4 at IMGREL
 ; SEH-NEXT:  .Llsda_end0:

Modified: llvm/trunk/test/CodeGen/X86/wineh-coreclr.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/wineh-coreclr.ll?rev=276898&r1=276897&r2=276898&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/wineh-coreclr.ll (original)
+++ llvm/trunk/test/CodeGen/X86/wineh-coreclr.ll Wed Jul 27 12:55:33 2016
@@ -283,57 +283,58 @@ tail:
 ;   }
 ; }
 ;
-; CHECK-LABEL: test2:     # @test2
-; CHECK-NEXT: [[test2_begin:.*func_begin.*]]:
 define void @test2() personality i8* bitcast (void ()* @ProcessCLRException to i8*) {
 entry:
-; CHECK: .seh_endprologue
-; CHECK: [[test2_before_f1:.+]]:
-; CHECK-NEXT: movl $1, %ecx
-; CHECK-NEXT: callq f
-; CHECK-NEXT: [[test2_after_f1:.+]]:
   invoke void @f(i32 1)
     to label %exit unwind label %fault
 fault:
-; CHECK: .seh_proc [[test2_fault:[^ ]+]]
   %fault.pad = cleanuppad within none [i32 undef]
-; CHECK: .seh_endprologue
-; CHECK: [[test2_before_f2:.+]]:
-; CHECK-NEXT: movl $2, %ecx
-; CHECK-NEXT: callq f
-; CHECK-NEXT: [[test2_after_f2:.+]]:
   invoke void @f(i32 2) ["funclet"(token %fault.pad)]
     to label %unreachable unwind label %exn.dispatch.inner
 exn.dispatch.inner:
   %catchswitch.inner = catchswitch within %fault.pad [label %catch1] unwind label %exn.dispatch.outer
 catch1:
   %catch.pad1 = catchpad within %catchswitch.inner [i32 1]
-; CHECK: .seh_proc [[test2_catch1:[^ ]+]]
   catchret from %catch.pad1 to label %unreachable
 exn.dispatch.outer:
   %catchswitch.outer = catchswitch within none [label %catch2] unwind to caller
 catch2:
   %catch.pad2 = catchpad within %catchswitch.outer [i32 2]
-; CHECK: .seh_proc [[test2_catch2:[^ ]+]]
   catchret from %catch.pad2 to label %exit
 exit:
   ret void
 unreachable:
   unreachable
-; CHECK: [[test2_end:.*func_end.*]]:
 }
+; CHECK-LABEL: test2:     # @test2
+; CHECK-NEXT: [[test2_begin:.*func_begin.*]]:
+; CHECK: .seh_endprologue
+; CHECK: [[test2_before_f1:.+]]:
+; CHECK-NEXT: movl $1, %ecx
+; CHECK-NEXT: callq f
+; CHECK-NEXT: [[test2_after_f1:.+]]:
+; CHECK: .seh_proc [[test2_catch1:[^ ]+]]
+; CHECK: .seh_proc [[test2_catch2:[^ ]+]]
+; CHECK: .seh_proc [[test2_fault:[^ ]+]]
+; CHECK: .seh_endprologue
+; CHECK: [[test2_before_f2:.+]]:
+; CHECK-NEXT: movl $2, %ecx
+; CHECK-NEXT: callq f
+; CHECK-NEXT: [[test2_after_f2:.+]]:
+; CHECK: [[test2_end:.*func_end.*]]:
+
 
 ; Now check for EH table in xdata (following standard xdata)
 ; CHECK-LABEL: .section .xdata
 ; standard xdata comes here
 ; CHECK:      .long 3{{$}}
 ;                   ^ number of funclets
-; CHECK-NEXT: .long [[test2_fault]]-[[test2_begin]]
-;                   ^ offset from L_begin to start of 1st funclet
 ; CHECK-NEXT: .long [[test2_catch1]]-[[test2_begin]]
 ;                   ^ offset from L_begin to start of 2nd funclet
 ; CHECK-NEXT: .long [[test2_catch2]]-[[test2_begin]]
 ;                   ^ offset from L_begin to start of 3rd funclet
+; CHECK-NEXT: .long [[test2_fault]]-[[test2_begin]]
+;                   ^ offset from L_begin to start of 1st funclet
 ; CHECK-NEXT: .long [[test2_end]]-[[test2_begin]]
 ;                   ^ offset from L_begin to end of last funclet
 ; CHECK-NEXT: .long 4
@@ -347,7 +348,7 @@ unreachable:
 ;                   ^ offset of end of clause
 ; CHECK-NEXT: .long [[test2_fault]]-[[test2_begin]]
 ;                   ^ offset of start of handler
-; CHECK-NEXT: .long [[test2_catch1]]-[[test2_begin]]
+; CHECK-NEXT: .long [[test2_end]]-[[test2_begin]]
 ;                   ^ offset of end of handler
 ; CHECK-NEXT: .long 0
 ;                   ^ type token slot (null for fault)
@@ -360,7 +361,7 @@ unreachable:
 ;                   ^ offset of end of clause
 ; CHECK-NEXT: .long [[test2_catch2]]-[[test2_begin]]
 ;                   ^ offset of start of handler
-; CHECK-NEXT: .long [[test2_end]]-[[test2_begin]]
+; CHECK-NEXT: .long [[test2_fault]]-[[test2_begin]]
 ;                   ^ offset of end of handler
 ; CHECK-NEXT: .long 2
 ;                   ^ type token of catch (from catchpad)
@@ -389,7 +390,7 @@ unreachable:
 ;                   ^ offset of end of clause
 ; CHECK-NEXT: .long [[test2_catch2]]-[[test2_begin]]
 ;                   ^ offset of start of handler
-; CHECK-NEXT: .long [[test2_end]]-[[test2_begin]]
+; CHECK-NEXT: .long [[test2_fault]]-[[test2_begin]]
 ;                   ^ offset of end of handler
 ; CHECK-NEXT: .long 2
 ;                   ^ type token of catch (from catchpad)




More information about the llvm-commits mailing list