1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 20:12:56 +02:00
llvm-mirror/test/CodeGen/X86/catchret-empty-fallthrough.ll
Jun Bum Lim 8b973fac5e Enhance BranchProbabilityInfo::calcUnreachableHeuristics for InvokeInst
This is recommit of r256028 with minor fixes in unittests:
  CodeGen/Mips/eh.ll
  CodeGen/Mips/insn-zero-size-bb.ll

Original commit message:

When identifying blocks post-dominated by an unreachable-terminated block
in BranchProbabilityInfo, consider only the edge to the normal destination
block if the terminator is InvokeInst and let calcInvokeHeuristics() decide
edge weights for the InvokeInst.

llvm-svn: 256202
2015-12-21 22:00:51 +00:00

54 lines
1.5 KiB
LLVM

; RUN: llc -verify-machineinstrs < %s | FileCheck %s
; BranchFolding used to remove our empty landingpad block, which is
; undesirable.
target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-windows-msvc18.0.0"
declare i32 @__C_specific_handler(...)
declare void @bar()
define void @foo(i1 %cond) personality i32 (...)* @__C_specific_handler {
entry:
br i1 %cond, label %return, label %try
try: ; preds = %entry
invoke void @bar()
to label %fallthrough unwind label %dispatch
dispatch: ; preds = %try
%cs1 = catchswitch within none [label %catch] unwind to caller
catch: ; preds = %dispatch
%0 = catchpad within %cs1 [i8* null]
catchret from %0 to label %return
fallthrough: ; preds = %try
unreachable
return: ; preds = %catch, %entry
ret void
}
; CHECK-LABEL: foo: # @foo
; CHECK: testb $1, %cl
; CHECK: je .LBB0_[[try:[0-9]+]]
; CHECK: .LBB0_[[return:[0-9]+]]:
; CHECK: retq
; CHECK: .LBB0_[[try]]:
; CHECK: .Ltmp0:
; CHECK: callq bar
; CHECK: .Ltmp1:
; CHECK: .LBB0_[[catch:[0-9]+]]:
; CHECK: .seh_handlerdata
; CHECK-NEXT: .Lfoo$parent_frame_offset = 32
; CHECK-NEXT: .long (.Llsda_end0-.Llsda_begin0)/16
; CHECK-NEXT: .Llsda_begin0:
; CHECK-NEXT: .long .Ltmp0@IMGREL+1
; CHECK-NEXT: .long .Ltmp1@IMGREL+1
; CHECK-NEXT: .long 1
; CHECK-NEXT: .long .LBB0_[[catch]]@IMGREL