[PATCH] D52845: Update entry count for cold calls

Wei Mi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 14 16:28:26 PST 2019


wmi added inline comments.


================
Comment at: lib/Transforms/Utils/InlineFunction.cpp:1486-1494
+        for (Instruction &I : BB)
+          if (CallInst *CI = dyn_cast<CallInst>(&I))
+            CI->updateProfWeight(newEntryCount, priorEntryCount);
+  } else {
+    // Otherwise ...
+    for (BasicBlock &BB : *Callee)
+      for (Instruction &I : BB)
----------------
Maybe use a lambda here to remove the code duplication?


================
Comment at: test/Transforms/SampleProfile/entry_counts_cold.ll:67-68
+
+; Function Attrs: nounwind ssp uwtable
+; CHECK: define i32 @bar({{.*}} !prof [[BAR:![0-9]+]] 
+define i32 @bar(i32* %p) #0 !dbg !48 {
----------------
Add check for the updated profile of the call instruction inside of bar? 


Repository:
  rL LLVM

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

https://reviews.llvm.org/D52845





More information about the llvm-commits mailing list