1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -passes=simplifycfg -sink-common-insts -S | FileCheck %s
4 target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128-ni:1-p2:32:8:8:32-ni:2"
5 target triple = "x86_64-unknown-linux-gnu"
7 define void @test_01(i1 %cond) gc "statepoint-example" personality ptr @zot {
8 ; CHECK-LABEL: @test_01(
10 ; CHECK-NEXT: br i1 [[COND:%.*]], label [[BB3:%.*]], label [[BB8:%.*]]
12 ; CHECK-NEXT: [[TMP4:%.*]] = call ptr @wibble()
13 ; CHECK-NEXT: [[TMP6:%.*]] = invoke align 8 dereferenceable_or_null(8) ptr addrspace(1) [[TMP4]](ptr addrspace(1) undef) [ "deopt"(i32 0) ]
14 ; CHECK-NEXT: to label [[BB7:%.*]] unwind label [[BB13:%.*]]
16 ; CHECK-NEXT: unreachable
18 ; CHECK-NEXT: [[TMP9:%.*]] = call ptr @wibble()
19 ; CHECK-NEXT: [[TMP11:%.*]] = invoke align 8 dereferenceable_or_null(8) ptr addrspace(1) [[TMP9]](ptr addrspace(1) undef) [ "deopt"(i32 1) ]
20 ; CHECK-NEXT: to label [[BB12:%.*]] unwind label [[BB13]]
22 ; CHECK-NEXT: unreachable
24 ; CHECK-NEXT: [[TMP14:%.*]] = landingpad { ptr, i32 }
26 ; CHECK-NEXT: ret void
29 br i1 %cond, label %bb3, label %bb8
35 %tmp4 = call ptr @wibble()
36 %tmp6 = invoke align 8 dereferenceable_or_null(8) ptr addrspace(1) %tmp4(ptr addrspace(1) undef) [ "deopt"(i32 0) ]
37 to label %bb7 unwind label %bb13
43 %tmp9 = call ptr @wibble()
44 %tmp11 = invoke align 8 dereferenceable_or_null(8) ptr addrspace(1) %tmp9(ptr addrspace(1) undef) [ "deopt"(i32 1) ]
45 to label %bb12 unwind label %bb13
50 bb13: ; preds = %bb8, %bb3
51 %tmp14 = landingpad { ptr, i32 }
56 define void @test_02(i1 %cond) gc "statepoint-example" personality ptr @zot {
57 ; CHECK-LABEL: @test_02(
59 ; CHECK-NEXT: [[TMP4:%.*]] = call ptr @wibble()
60 ; CHECK-NEXT: [[TMP0:%.*]] = invoke align 8 dereferenceable_or_null(8) ptr addrspace(1) [[TMP4]](ptr addrspace(1) undef) [ "deopt"(i32 0) ]
61 ; CHECK-NEXT: to label [[BB8_CONT:%.*]] unwind label [[BB13:%.*]]
63 ; CHECK-NEXT: unreachable
65 ; CHECK-NEXT: [[TMP14:%.*]] = landingpad { ptr, i32 }
67 ; CHECK-NEXT: ret void
70 br i1 %cond, label %bb3, label %bb8
76 %tmp4 = call ptr @wibble()
77 %tmp6 = invoke align 8 dereferenceable_or_null(8) ptr addrspace(1) %tmp4(ptr addrspace(1) undef) [ "deopt"(i32 0) ]
78 to label %bb7 unwind label %bb13
84 %tmp9 = call ptr @wibble()
85 %tmp11 = invoke align 8 dereferenceable_or_null(8) ptr addrspace(1) %tmp9(ptr addrspace(1) undef) [ "deopt"(i32 0) ]
86 to label %bb12 unwind label %bb13
91 bb13: ; preds = %bb8, %bb3
92 %tmp14 = landingpad { ptr, i32 }
100 declare ptr @wibble()