Instead of adding a ".unlikely" or ".eh" suffix for machine basic blocks,
this change updates the behaviour to use an appropriate prefix
instead. This allows lld to group basic block sections together
when -z,keep-text-section-prefix is specified and matches the behaviour
observed in gcc.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | ||
---|---|---|
889 | 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. |
Use a ".text.eh" prefix instead of ".eh" suffix for exception machine basic block sections.
Update the basic-block-sections-clusters-eh test.
llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | ||
---|---|---|
889 | 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. |
This is a small change and looks good to me. I think this is consistent with what the linker expects for unlikely sections, so I am approving it. Adding @efriedma just to be sure. Please wait for a response before pushing.
llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | ||
---|---|---|
881 | Nit, use braces around the else too. |
Thanks for the reviews @eli.friedman @tmsriram.
Can someone go ahead and push this this for me since I don't have commit access?
Nit, use braces around the else too.