[PATCH] D78742: Use .text.unlikely and .text.eh prefixes for MachineBasicBlock sections.

Snehasish Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 23 15:47:53 PDT 2020


snehasish marked an inline comment as done.
snehasish added inline comments.


================
Comment at: llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp:870
+  if (MBB.getSectionID() == MBBSectionID::ColdSectionID) {
+    Name += ".text.unlikely.";
+    Name += MBB.getParent()->getName();
----------------
tmsriram wrote:
> This looks good.  This should also be done for ".eh", .text.eh must be the prefix.  Further,  the parent name must only be appended for unlikely and eh sections as there is only one such section for each function and using the function name guarantees that.
> 
> For other sections, there is no need to append the parent name.  Either it should be .text (or .text.hot) or .text.<MBBSymbolName> when UniqueBBSectionNames is used.  Does this make sense?  Thanks for working on this.
Done. I've updated the diff to use the ".text.eh" prefix as suggested.

The behaviour for the other sections is actually unchanged. We use the name of the parent section and not the parent. I just removed the static_cast to MCSectionELF* before calling getName() since it is unnecessary. 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D78742





More information about the llvm-commits mailing list