1 ; RUN: opt -pgo-kind=pgo-instr-gen-pipeline -passes="default<O3>" -enable-nontrivial-unswitch -S < %s | FileCheck %s
4 target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
5 target triple = "x86_64-unknown-linux-gnu"
7 @__profn_c = private constant [1 x i8] c"c"
8 @b = common dso_local global i32 0, align 4
9 @a = common dso_local global i16 0, align 2
12 ; Function Attrs: nounwind uwtable
13 define dso_local void @c() #0 {
15 call void @llvm.instrprof.increment(ptr @__profn_c, i64 68269137, i32 3, i32 0)
18 for.cond: ; preds = %for.end, %entry
19 call void @llvm.instrprof.increment(ptr @__profn_c, i64 68269137, i32 3, i32 1)
20 store i32 0, ptr @b, align 4
23 for.cond1: ; preds = %for.inc, %for.cond
24 %0 = load i32, ptr @b, align 4
25 %1 = load i16, ptr @a, align 2
26 %conv = sext i16 %1 to i32
27 %cmp = icmp slt i32 %0, %conv
28 br i1 %cmp, label %for.body, label %for.end
30 for.body: ; preds = %for.cond1
31 call void @llvm.instrprof.increment(ptr @__profn_c, i64 68269137, i32 3, i32 2)
34 for.inc: ; preds = %for.body
35 %2 = load i32, ptr @b, align 4
36 %inc = add nsw i32 %2, 1
37 store i32 %inc, ptr @b, align 4
40 for.end: ; preds = %for.cond1
44 ; Function Attrs: nounwind
45 declare void @llvm.instrprof.increment(ptr, i64, i32, i32) #1
47 attributes #0 = { nounwind uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="none" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
48 attributes #1 = { nounwind }