1; RUN: opt -pgo-kind=pgo-instr-gen-pipeline -passes="default<O3>" -enable-nontrivial-unswitch -S < %s | FileCheck %s 2; REQUIRES: asserts 3 4target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" 5target triple = "x86_64-unknown-linux-gnu" 6 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 10 11; CHECK-LABEL: @c() 12; Function Attrs: nounwind uwtable 13define dso_local void @c() #0 { 14entry: 15 call void @llvm.instrprof.increment(ptr @__profn_c, i64 68269137, i32 3, i32 0) 16 br label %for.cond 17 18for.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 21 br label %for.cond1 22 23for.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 29 30for.body: ; preds = %for.cond1 31 call void @llvm.instrprof.increment(ptr @__profn_c, i64 68269137, i32 3, i32 2) 32 br label %for.inc 33 34for.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 38 br label %for.cond1 39 40for.end: ; preds = %for.cond1 41 br label %for.cond 42} 43 44; Function Attrs: nounwind 45declare void @llvm.instrprof.increment(ptr, i64, i32, i32) #1 46 47attributes #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" } 48attributes #1 = { nounwind } 49 50