brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · 743ca89 Raw
49 lines · plain
1; RUN: opt -passes="ipsccp<func-spec>" -funcspec-min-function-size=3 -S < %s | FileCheck %s2 3; Checks for callsites that have been annotated with MinSize. We only expect4; specialisation for the call that does not have the attribute:5;6; CHECK: plus:7; CHECK:   %tmp0 = call i64 @compute.specialized.1(i64 %x, ptr @plus)8; CHECK:   br label %merge9; CHECK: minus:10; CHECK:   %tmp1 = call i64 @compute(i64 %x, ptr @minus) #011; CHECK:   br label %merge12;13define i64 @main(i64 %x, i1 %flag) {14entry:15  br i1 %flag, label %plus, label %minus16 17plus:18  %tmp0 = call i64 @compute(i64 %x, ptr @plus)19  br label %merge20 21minus:22  %tmp1 = call i64 @compute(i64 %x, ptr @minus) #023  br label %merge24 25merge:26  %tmp2 = phi i64 [ %tmp0, %plus ], [ %tmp1, %minus]27  ret i64 %tmp228}29 30define internal i64 @compute(i64 %x, ptr %binop) {31entry:32  %tmp0 = call i64 %binop(i64 %x)33  ret i64 %tmp034}35 36define internal i64 @plus(i64 %x) {37entry:38  %tmp0 = add i64 %x, 139  ret i64 %tmp040}41 42define internal i64 @minus(i64 %x) {43entry:44  %tmp0 = sub i64 %x, 145  ret i64 %tmp046}47 48attributes #0 = { minsize optsize }49