brintos

brintos / llvm-project-archived public Read only

0
0
Text · 783 B · c1ca3eb Raw
40 lines · plain
1; REQUIRES: asserts2; RUN: opt -stats -passes="ipsccp<func-spec>" -S -force-specialization < %s 2>&1 | FileCheck %s3 4; CHECK: 2 function-specialization - Number of specializations created5 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) {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