40 lines · plain
1; RUN: opt -passes="ipsccp<func-spec>" -S < %s | FileCheck %s2 3; CHECK-NOT: @compute.specialized.14; CHECK-NOT: @compute.specialized.25 6define i64 @main(i64 %x, i1 %flag) {7entry:8 br i1 %flag, label %plus, label %minus9 10plus:11 %tmp0 = call i64 @compute(i64 %x, ptr @plus)12 br label %merge13 14minus:15 %tmp1 = call i64 @compute(i64 %x, ptr @minus)16 br label %merge17 18merge:19 %tmp2 = phi i64 [ %tmp0, %plus ], [ %tmp1, %minus]20 ret i64 %tmp221}22 23define internal i64 @compute(i64 %x, ptr %binop) minsize {24entry:25 %tmp0 = call i64 %binop(i64 %x)26 ret i64 %tmp027}28 29define internal i64 @plus(i64 %x) {30entry:31 %tmp0 = add i64 %x, 132 ret i64 %tmp033}34 35define internal i64 @minus(i64 %x) {36entry:37 %tmp0 = sub i64 %x, 138 ret i64 %tmp039}40