34 lines · plain
1; RUN: opt -passes=instcombine -S < %s | FileCheck %s2; RUN: opt -debugify-each -passes=instcombine -S < %s | FileCheck %s3 4; These are both direct calls, but make sure instcombine leaves the casts5; alone.6 7define i32 @call_thunk(i32 %x, i32 %y) {8 %r = call i32 @inc_first_arg_thunk(i32 %x, i32 %y)9 ret i32 %r10}11 12; CHECK-LABEL: define i32 @call_thunk(i32 %x, i32 %y)13; CHECK: %r = call i32 @inc_first_arg_thunk(i32 %x, i32 %y)14; CHECK: ret i32 %r15 16define internal void @inc_first_arg_thunk(i32 %arg1, ...) #0 {17entry:18 %inc = add i32 %arg1, 119 musttail call void (i32, ...) @plus(i32 %inc, ...)20 ret void21}22 23; CHECK-LABEL: define internal void @inc_first_arg_thunk(i32 %arg1, ...) #024; CHECK: %inc = add i32 %arg1, 125; CHECK: musttail call void (i32, ...) @plus(i32 %inc, ...)26; CHECK: ret void27 28define internal i32 @plus(i32 %x, i32 %y) {29 %r = add i32 %x, %y30 ret i32 %r31}32 33attributes #0 = { "thunk" }34