[PATCH] D36722: [InlineCost] Simplify the cold attribute handling in inline-cost.

Chandler Carruth via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 14 17:36:12 PDT 2017


chandlerc added inline comments.


================
Comment at: lib/Analysis/InlineCost.cpp:659
+  // should *always* be considered cold.
+  if (Callee.hasFnAttribute(Attribute::Cold))
+    return true;
----------------
davidxl wrote:
> IIRC, static branch prediction already handles this case. Do you see missing cases?
Sorry, I tried to explain in my top-level description -- there are cases where despite being cold, the call site won't be cold relative to the function entry. For example, when the call site is *in* the function entry block.

Maybe this still isn't making sense? I can add an example bit of code.


https://reviews.llvm.org/D36722





More information about the llvm-commits mailing list