Skip to content

Instantly share code, notes, and snippets.

@minglotus-6
Created December 6, 2023 06:30
Show Gist options
  • Save minglotus-6/11817ba645c6b12cd7116f41bfb1185e to your computer and use it in GitHub Desktop.
Save minglotus-6/11817ba645c6b12cd7116f41bfb1185e to your computer and use it in GitHub Desktop.
source_filename = "lib.cc"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
@calleeAddrs = dso_local local_unnamed_addr global [2 x ptr] [ptr @_ZL7callee0v, ptr @_Z7callee1v], align 16
; Function Attrs: inlinehint mustprogress nounwind uwtable
define dso_local void @_Z7callee1v() #0 !prof !34 {
entry:
ret void
}
; Function Attrs: inlinehint mustprogress nounwind uwtable
define internal void @_ZL7callee0v() #0 !prof !35 !PGOFuncName !36 {
entry:
ret void
}
; Function Attrs: inlinehint mustprogress uwtable
define dso_local void @_Z11global_funcv() local_unnamed_addr #1 !prof !37 {
entry:
br label %for.cond
for.cond: ; preds = %for.body, %entry
%i.0 = phi i32 [ 0, %entry ], [ %inc, %for.body ]
%cmp = icmp ult i32 %i.0, 5
br i1 %cmp, label %for.body, label %for.cond.cleanup, !prof !38
for.cond.cleanup: ; preds = %for.cond
ret void
for.body: ; preds = %for.cond
%rem = and i32 %i.0, 1
%idxprom = zext nneg i32 %rem to i64
%arrayidx = getelementptr inbounds [2 x ptr], ptr @calleeAddrs, i64 0, i64 %idxprom
%0 = load ptr, ptr %arrayidx, align 8, !tbaa !39
call void %0(), !prof !43
%inc = add nuw nsw i32 %i.0, 1
br label %for.cond, !llvm.loop !44
}
attributes #0 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
!llvm.module.flags = !{!0, !1, !2, !3, !4}
!llvm.ident = !{!33}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{i32 1, !"ProfileSummary", !5}
!5 = !{!6, !7, !8, !9, !10, !11, !12, !13, !14, !15}
!6 = !{!"ProfileFormat", !"InstrProf"}
!7 = !{!"TotalCount", i64 12}
!8 = !{!"MaxCount", i64 5}
!9 = !{!"MaxInternalCount", i64 1}
!10 = !{!"MaxFunctionCount", i64 5}
!11 = !{!"NumCounts", i64 5}
!12 = !{!"NumFunctions", i64 4}
!13 = !{!"IsPartialProfile", i64 0}
!14 = !{!"PartialProfileRatio", double 0.000000e+00}
!15 = !{!"DetailedSummary", !16}
!16 = !{!17, !18, !19, !20, !21, !22, !23, !24, !25, !26, !27, !28, !29, !30, !31, !32}
!17 = !{i32 10000, i64 0, i32 0}
!18 = !{i32 100000, i64 5, i32 1}
!19 = !{i32 200000, i64 5, i32 1}
!20 = !{i32 300000, i64 5, i32 1}
!21 = !{i32 400000, i64 5, i32 1}
!22 = !{i32 500000, i64 3, i32 2}
!23 = !{i32 600000, i64 3, i32 2}
!24 = !{i32 700000, i64 3, i32 2}
!25 = !{i32 800000, i64 2, i32 3}
!26 = !{i32 900000, i64 2, i32 3}
!27 = !{i32 950000, i64 1, i32 5}
!28 = !{i32 990000, i64 1, i32 5}
!29 = !{i32 999000, i64 1, i32 5}
!30 = !{i32 999900, i64 1, i32 5}
!31 = !{i32 999990, i64 1, i32 5}
!32 = !{i32 999999, i64 1, i32 5}
!33 = !{!"clang version 18.0.0 (https://github.com/minglotus-6/llvm-project.git 413bcb5e64fa846852b50f41b4c8e584e510d00f)"}
!34 = !{!"function_entry_count", i64 2}
!35 = !{!"function_entry_count", i64 3}
!36 = !{!"lib.cc;_ZL7callee0v"}
!37 = !{!"function_entry_count", i64 1}
!38 = !{!"branch_weights", i32 5, i32 1}
!39 = !{!40, !40, i64 0}
!40 = !{!"any pointer", !41, i64 0}
!41 = !{!"omnipotent char", !42, i64 0}
!42 = !{!"Simple C++ TBAA"}
!43 = !{!"VP", i32 0, i64 5, i64 8947761083887884635, i64 3, i64 -3993653843325621743, i64 2}
!44 = distinct !{!44, !45}
!45 = !{!"llvm.loop.mustprogress"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment