summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Kaylor <andrew.kaylor@intel.com>2016-07-27 17:55:33 +0000
committerAndrew Kaylor <andrew.kaylor@intel.com>2016-07-27 17:55:33 +0000
commit9155354ff2445fa0d4442ada7d42eac38aef7f85 (patch)
treef6345fa9dfa32955b778458efb8f0a2a5aa3266f
parent8d2f52e035ceb361d3410d2b76b48a287c529356 (diff)
downloadbcm5719-llvm-9155354ff2445fa0d4442ada7d42eac38aef7f85.tar.gz
bcm5719-llvm-9155354ff2445fa0d4442ada7d42eac38aef7f85.zip
Revert EH-specific checks in BranchFolding that were causing blow ups in compile time.
Differential Revision: https://reviews.llvm.org/D22839 llvm-svn: 276898
-rw-r--r--llvm/lib/CodeGen/BranchFolding.cpp8
-rw-r--r--llvm/test/CodeGen/WinEH/wineh-noret-cleanup.ll12
-rw-r--r--llvm/test/CodeGen/X86/wineh-coreclr.ll43
3 files changed, 28 insertions, 35 deletions
diff --git a/llvm/lib/CodeGen/BranchFolding.cpp b/llvm/lib/CodeGen/BranchFolding.cpp
index fa705761645..d2ffd214b28 100644
--- a/llvm/lib/CodeGen/BranchFolding.cpp
+++ b/llvm/lib/CodeGen/BranchFolding.cpp
@@ -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)) {
diff --git a/llvm/test/CodeGen/WinEH/wineh-noret-cleanup.ll b/llvm/test/CodeGen/WinEH/wineh-noret-cleanup.ll
index 7d4d833aa9b..85241c6d42d 100644
--- a/llvm/test/CodeGen/WinEH/wineh-noret-cleanup.ll
+++ b/llvm/test/CodeGen/WinEH/wineh-noret-cleanup.ll
@@ -50,13 +50,13 @@ catch.body.2:
; CXX-NEXT: .long 1
; CXX-NEXT: .long .Ltmp1@IMGREL+1
; CXX-NEXT: .long -1
-; CXX-NEXT: .long "?catch$3@?0?test@4HA"@IMGREL
+; CXX-NEXT: .long "?catch$2@?0?test@4HA"@IMGREL
; CXX-NEXT: .long 2
; CXX-NEXT: .long .Ltmp2@IMGREL+1
; CXX-NEXT: .long 3
; CXX-NEXT: .long .Ltmp3@IMGREL+1
; CXX-NEXT: .long 2
-; CXX-NEXT: .long "?catch$5@?0?test@4HA"@IMGREL
+; CXX-NEXT: .long "?catch$4@?0?test@4HA"@IMGREL
; CXX-NEXT: .long 4
; SEH-LABEL: test:
@@ -64,17 +64,17 @@ catch.body.2:
; SEH-NEXT: .long .Ltmp0@IMGREL+1
; SEH-NEXT: .long .Ltmp1@IMGREL+1
; SEH-NEXT: .long dummy_filter@IMGREL
-; SEH-NEXT: .long .LBB0_3@IMGREL
+; SEH-NEXT: .long .LBB0_2@IMGREL
; SEH-NEXT: .long .Ltmp0@IMGREL+1
; SEH-NEXT: .long .Ltmp1@IMGREL+1
; SEH-NEXT: .long dummy_filter@IMGREL
-; SEH-NEXT: .long .LBB0_5@IMGREL
+; SEH-NEXT: .long .LBB0_4@IMGREL
; SEH-NEXT: .long .Ltmp2@IMGREL+1
; SEH-NEXT: .long .Ltmp3@IMGREL+1
-; SEH-NEXT: .long "?dtor$2@?0?test@4HA"@IMGREL
+; SEH-NEXT: .long "?dtor$5@?0?test@4HA"@IMGREL
; SEH-NEXT: .long 0
; SEH-NEXT: .long .Ltmp2@IMGREL+1
; SEH-NEXT: .long .Ltmp3@IMGREL+1
; SEH-NEXT: .long dummy_filter@IMGREL
-; SEH-NEXT: .long .LBB0_5@IMGREL
+; SEH-NEXT: .long .LBB0_4@IMGREL
; SEH-NEXT: .Llsda_end0:
diff --git a/llvm/test/CodeGen/X86/wineh-coreclr.ll b/llvm/test/CodeGen/X86/wineh-coreclr.ll
index a7e40c036e7..af6bef57ec7 100644
--- a/llvm/test/CodeGen/X86/wineh-coreclr.ll
+++ b/llvm/test/CodeGen/X86/wineh-coreclr.ll
@@ -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)
OpenPOWER on IntegriCloud