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 i32* ()* @zot {
8 ; CHECK-LABEL: @test_01(
10 ; CHECK-NEXT: [[DOT:%.*]] = select i1 [[COND:%.*]], i32 0, i32 1
11 ; CHECK-NEXT: [[TMP4:%.*]] = call i8* @wibble()
12 ; CHECK-NEXT: [[TMP5:%.*]] = bitcast i8* [[TMP4]] to i8 addrspace(1)* (i8 addrspace(1)*)*
13 ; CHECK-NEXT: [[TMP0:%.*]] = invoke align 8 dereferenceable_or_null(8) i8 addrspace(1)* [[TMP5]](i8 addrspace(1)* undef) [ "deopt"(i32 [[DOT]]) ]
14 ; CHECK-NEXT: to label [[BB8_CONT:%.*]] unwind label [[BB13:%.*]]
16 ; CHECK-NEXT: unreachable
18 ; CHECK-NEXT: [[TMP14:%.*]] = landingpad { i8*, i32 }
20 ; CHECK-NEXT: ret void
23 br i1 %cond, label %bb3, label %bb8
29 %tmp4 = call i8* @wibble()
30 %tmp5 = bitcast i8* %tmp4 to i8 addrspace(1)* (i8 addrspace(1)*)*
31 %tmp6 = invoke align 8 dereferenceable_or_null(8) i8 addrspace(1)* %tmp5(i8 addrspace(1)* undef) [ "deopt"(i32 0) ]
32 to label %bb7 unwind label %bb13
38 %tmp9 = call i8* @wibble()
39 %tmp10 = bitcast i8* %tmp9 to i8 addrspace(1)* (i8 addrspace(1)*)*
40 %tmp11 = invoke align 8 dereferenceable_or_null(8) i8 addrspace(1)* %tmp10(i8 addrspace(1)* undef) [ "deopt"(i32 1) ]
41 to label %bb12 unwind label %bb13
46 bb13: ; preds = %bb8, %bb3
47 %tmp14 = landingpad { i8*, i32 }
52 define void @test_02(i1 %cond) gc "statepoint-example" personality i32* ()* @zot {
53 ; CHECK-LABEL: @test_02(
55 ; CHECK-NEXT: [[TMP4:%.*]] = call i8* @wibble()
56 ; CHECK-NEXT: [[TMP5:%.*]] = bitcast i8* [[TMP4]] to i8 addrspace(1)* (i8 addrspace(1)*)*
57 ; CHECK-NEXT: [[TMP0:%.*]] = invoke align 8 dereferenceable_or_null(8) i8 addrspace(1)* [[TMP5]](i8 addrspace(1)* undef) [ "deopt"(i32 0) ]
58 ; CHECK-NEXT: to label [[BB8_CONT:%.*]] unwind label [[BB13:%.*]]
60 ; CHECK-NEXT: unreachable
62 ; CHECK-NEXT: [[TMP14:%.*]] = landingpad { i8*, i32 }
64 ; CHECK-NEXT: ret void
67 br i1 %cond, label %bb3, label %bb8
73 %tmp4 = call i8* @wibble()
74 %tmp5 = bitcast i8* %tmp4 to i8 addrspace(1)* (i8 addrspace(1)*)*
75 %tmp6 = invoke align 8 dereferenceable_or_null(8) i8 addrspace(1)* %tmp5(i8 addrspace(1)* undef) [ "deopt"(i32 0) ]
76 to label %bb7 unwind label %bb13
82 %tmp9 = call i8* @wibble()
83 %tmp10 = bitcast i8* %tmp9 to i8 addrspace(1)* (i8 addrspace(1)*)*
84 %tmp11 = invoke align 8 dereferenceable_or_null(8) i8 addrspace(1)* %tmp10(i8 addrspace(1)* undef) [ "deopt"(i32 0) ]
85 to label %bb12 unwind label %bb13
90 bb13: ; preds = %bb8, %bb3
91 %tmp14 = landingpad { i8*, i32 }