1 ; RUN: opt -dse -inline -S %s | FileCheck %s
3 declare void @external(i32* byval)
4 declare i32 @identity(i32* byval)
6 ; An alloca in the inlinee should not force the tail to be stripped
8 define void @inlinee_with_alloca() {
10 store i32 42, i32* %local, align 4
11 tail call void @external(i32* byval %local)
15 define void @inliner_without_alloca() {
16 tail call void @inlinee_with_alloca()
20 ; CHECK-LABEL: inliner_without_alloca
21 ; CHECK-NEXT: %local.i = alloca i32
22 ; CHECK: store i32 42, i32* %local.i
23 ; CHECK: tail call void @external
26 ; An alloca in the inliner should not force the tail to be stripped
28 define i32 @inliner_with_alloca() {
30 store i32 42, i32* %local, align 4
31 %1 = tail call i32 @identity(i32* byval %local)
35 ; CHECK-LABEL: inliner_with_alloca
36 ; CHECK: %local = alloca i32
37 ; CHECK: store i32 42, i32* %local
38 ; CHECK: %1 = tail call i32 @identity
41 ; Force the synthesis of the value through the byval parameter.
42 ; The alloca should force the tail to be stripped
44 define void @inlinee_with_passthru(i32* byval %value) {
45 tail call void @external(i32* byval %value)
49 define void @strip_tail(i32* %value) {
50 tail call void @inlinee_with_passthru(i32* %value)
54 ; CHECK-LABEL: strip_tail
55 ; CHECK: %value1 = alloca i32
56 ; CHECK: {{^ *}}call void @external