17b1d7937SAmy Huangtarget datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" 2cee313d2SEric Christophertarget triple = "x86_64-unknown-linux-gnu" 3cee313d2SEric Christopher 4cee313d2SEric Christopher@odd = common dso_local global i32 0, align 4 5cee313d2SEric Christopher@even = common dso_local global i32 0, align 4 6cee313d2SEric Christopher 7cee313d2SEric Christopherdefine dso_local void @bar(i32 %n) #0 !prof !29 { 8cee313d2SEric Christopherentry: 9cee313d2SEric Christopher %call = tail call fastcc i32 @cond(i32 %n) 10cee313d2SEric Christopher %tobool = icmp eq i32 %call, 0 11cee313d2SEric Christopher br i1 %tobool, label %if.else, label %if.then, !prof !30 12cee313d2SEric Christopher 13cee313d2SEric Christopherif.then: 14ed9df5bdSFlorian Hahn ; The calls here ensure that the instructions are not hoisted by SimplifyCFG. 15ed9df5bdSFlorian Hahn call void @clobber() 16*9ff36df5SFangrui Song %0 = load i32, ptr @odd, align 4 17cee313d2SEric Christopher %inc = add i32 %0, 1 18*9ff36df5SFangrui Song store i32 %inc, ptr @odd, align 4 19ed9df5bdSFlorian Hahn call void @clobber() 20cee313d2SEric Christopher br label %if.end 21cee313d2SEric Christopher 22cee313d2SEric Christopherif.else: 23*9ff36df5SFangrui Song %1 = load i32, ptr @even, align 4 24cee313d2SEric Christopher %inc1 = add i32 %1, 1 25*9ff36df5SFangrui Song store i32 %inc1, ptr @even, align 4 26cee313d2SEric Christopher br label %if.end 27cee313d2SEric Christopher 28cee313d2SEric Christopherif.end: 29cee313d2SEric Christopher ret void 30cee313d2SEric Christopher} 31cee313d2SEric Christopher 32ed9df5bdSFlorian Hahndeclare void @clobber() 33ed9df5bdSFlorian Hahn 34cee313d2SEric Christopherdefine internal fastcc i32 @cond(i32 %i) #1 !prof !29 !PGOFuncName !35 { 35cee313d2SEric Christopherentry: 36cee313d2SEric Christopher %rem = srem i32 %i, 2 37cee313d2SEric Christopher ret i32 %rem 38cee313d2SEric Christopher} 39cee313d2SEric Christopher 40cee313d2SEric Christopherattributes #0 = { "target-cpu"="x86-64" } 41cee313d2SEric Christopherattributes #1 = { inlinehint noinline } 42cee313d2SEric Christopher 43cee313d2SEric Christopher!llvm.module.flags = !{!0, !1} 44cee313d2SEric Christopher 45cee313d2SEric Christopher!0 = !{i32 1, !"wchar_size", i32 4} 46cee313d2SEric Christopher!1 = !{i32 1, !"ProfileSummary", !2} 47cee313d2SEric Christopher!2 = !{!3, !4, !5, !6, !7, !8, !9, !10} 48cee313d2SEric Christopher!3 = !{!"ProfileFormat", !"InstrProf"} 49cee313d2SEric Christopher!4 = !{!"TotalCount", i64 500002} 50cee313d2SEric Christopher!5 = !{!"MaxCount", i64 200000} 51cee313d2SEric Christopher!6 = !{!"MaxInternalCount", i64 100000} 52cee313d2SEric Christopher!7 = !{!"MaxFunctionCount", i64 200000} 53cee313d2SEric Christopher!8 = !{!"NumCounts", i64 6} 54cee313d2SEric Christopher!9 = !{!"NumFunctions", i64 4} 55cee313d2SEric Christopher!10 = !{!"DetailedSummary", !11} 56cee313d2SEric Christopher!11 = !{!12, !13, !14, !15, !16, !17, !18, !19, !20, !21, !22, !23, !24, !25, !26, !27} 57cee313d2SEric Christopher!12 = !{i32 10000, i64 200000, i32 1} 58cee313d2SEric Christopher!13 = !{i32 100000, i64 200000, i32 1} 59cee313d2SEric Christopher!14 = !{i32 200000, i64 200000, i32 1} 60cee313d2SEric Christopher!15 = !{i32 300000, i64 200000, i32 1} 61cee313d2SEric Christopher!16 = !{i32 400000, i64 200000, i32 1} 62cee313d2SEric Christopher!17 = !{i32 500000, i64 100000, i32 4} 63cee313d2SEric Christopher!18 = !{i32 600000, i64 100000, i32 4} 64cee313d2SEric Christopher!19 = !{i32 700000, i64 100000, i32 4} 65cee313d2SEric Christopher!20 = !{i32 800000, i64 100000, i32 4} 66cee313d2SEric Christopher!21 = !{i32 900000, i64 100000, i32 4} 67cee313d2SEric Christopher!22 = !{i32 950000, i64 100000, i32 4} 68cee313d2SEric Christopher!23 = !{i32 990000, i64 100000, i32 4} 69cee313d2SEric Christopher!24 = !{i32 999000, i64 100000, i32 4} 70cee313d2SEric Christopher!25 = !{i32 999900, i64 100000, i32 4} 71cee313d2SEric Christopher!26 = !{i32 999990, i64 100000, i32 4} 72cee313d2SEric Christopher!27 = !{i32 999999, i64 1, i32 6} 73cee313d2SEric Christopher!29 = !{!"function_entry_count", i64 200000} 74cee313d2SEric Christopher!30 = !{!"branch_weights", i32 100000, i32 100000} 75cee313d2SEric Christopher!35 = !{!"cspgo_bar.c:cond"} 76