[PATCH] D69384: Add unlikely attribute to outlined function

Aditya Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 24 14:26:46 PDT 2019


hiraditya updated this revision to Diff 226329.
hiraditya added a comment.

test case


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

https://reviews.llvm.org/D69384

Files:
  llvm/lib/Transforms/IPO/HotColdSplitting.cpp
  llvm/test/Transforms/HotColdSplit/coldentrycount.ll


Index: llvm/test/Transforms/HotColdSplit/coldentrycount.ll
===================================================================
--- llvm/test/Transforms/HotColdSplit/coldentrycount.ll
+++ llvm/test/Transforms/HotColdSplit/coldentrycount.ll
@@ -41,3 +41,5 @@
 !12 = !{i32 999000, i64 100, i32 1}
 !13 = !{i32 999999, i64 1, i32 2}
 !14 = !{!"function_entry_count", i64 100}
+!15 = !{!"function_entry_count", i64 0}
+!16 = !{!"function_section_prefix", !".unlikely"}
Index: llvm/lib/Transforms/IPO/HotColdSplitting.cpp
===================================================================
--- llvm/lib/Transforms/IPO/HotColdSplitting.cpp
+++ llvm/lib/Transforms/IPO/HotColdSplitting.cpp
@@ -164,6 +164,7 @@
     Changed = true;
   }
 
+  F.setSectionPrefix(".unlikely");
   return Changed;
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D69384.226329.patch
Type: text/x-patch
Size: 790 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191024/0233de85/attachment.bin>


More information about the llvm-commits mailing list