[PATCH] D159336: Statically analyze likely and unlikely blocks based on metadata

Teresa Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 11 19:36:41 PDT 2023


tejohnson accepted this revision.
tejohnson added a comment.
This revision is now accepted and ready to land.

lgtm wth a couple of small test tweaks.



================
Comment at: llvm/test/Transforms/HotColdSplit/split-static-profile.ll:4
+
+; Check that the unlikely branch is outlined. Override internal branch thresholds with -hotcoldsplit-cold-probability-denom
+; int cold(const char*);
----------------
Suggest moving this comment to the top of file


================
Comment at: llvm/test/Transforms/HotColdSplit/split-static-profile.ll:98
+
+; CHECK-PROB: internal void @baz.cold.1() #[[ATTR0:[0-9]+]]
+; CHECK-PROB-NEXT: newFuncRoot
----------------
Suggest moving these CHECK-PROB lines up earlier, to where you have the CHECK-NOOUTLINE-BAZ-NOT, and the checks for the other 2 functions, so that all the checks are consolidated.


================
Comment at: llvm/test/Transforms/HotColdSplit/split-static-profile.ll:102
+; CHECK-PROB: tail call noundef i32 @cold
+; CHECK-PROB: attributes #[[ATTR0]] = { cold minsize }
+define dso_local void @baz(i32 noundef %a, i32 noundef %b) local_unnamed_addr {
----------------
Probably check the attributes once with CHECK-OUTLINE, which covers both cases (I think the CHECK-OUTLINE,CHECK-NOOUTLINE-BAZ case is not checking the attributes currently).


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D159336/new/

https://reviews.llvm.org/D159336



More information about the llvm-commits mailing list