51 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature2; RUN: opt -S < %s -passes=argpromotion | FileCheck %s3 4; This shouldn't get infinitely promoted.5 6%S = type { ptr }7 8define i32 @test_inf_promote_caller(i32 %arg) {9; CHECK-LABEL: define {{[^@]+}}@test_inf_promote_caller10; CHECK-SAME: (i32 [[ARG:%.*]]) {11; CHECK-NEXT: bb:12; CHECK-NEXT: [[TEMP:%.*]] = alloca [[S:%.*]], align 813; CHECK-NEXT: [[TEMP1:%.*]] = alloca [[S]], align 814; CHECK-NEXT: [[TEMP2:%.*]] = call i32 @test_inf_promote_callee(ptr [[TEMP]], ptr [[TEMP1]])15; CHECK-NEXT: ret i32 016;17bb:18 %temp = alloca %S19 %temp1 = alloca %S20 %temp2 = call i32 @test_inf_promote_callee(ptr %temp, ptr %temp1)21 ret i32 022}23 24define internal i32 @test_inf_promote_callee(ptr %arg, ptr %arg1) {25; CHECK-LABEL: define {{[^@]+}}@test_inf_promote_callee26; CHECK-SAME: (ptr [[ARG:%.*]], ptr [[ARG1:%.*]]) {27; CHECK-NEXT: bb:28; CHECK-NEXT: [[TEMP2:%.*]] = load ptr, ptr [[ARG1]], align 829; CHECK-NEXT: [[TEMP4:%.*]] = load ptr, ptr [[ARG]], align 830; CHECK-NEXT: [[TEMP5:%.*]] = call i32 @test_inf_promote_callee2(ptr [[TEMP4]], ptr [[TEMP2]])31; CHECK-NEXT: ret i32 032;33bb:34 %temp2 = load ptr, ptr %arg135 %temp4 = load ptr, ptr %arg36 %temp5 = call i32 @test_inf_promote_callee2(ptr %temp4, ptr %temp2)37 ret i32 038}39 40define internal i32 @test_inf_promote_callee2(ptr %arg, ptr %arg1) {41; CHECK-LABEL: define {{[^@]+}}@test_inf_promote_callee242; CHECK-SAME: (ptr [[ARG:%.*]], ptr [[ARG1:%.*]]) {43; CHECK-NEXT: [[R:%.*]] = call i32 @test_inf_promote_callee(ptr [[ARG]], ptr [[ARG1]])44; CHECK-NEXT: ret i32 045;46 %r = call i32 @test_inf_promote_callee(ptr %arg, ptr %arg1)47 ret i32 048}49 50declare i32 @wibble(...)51