[PATCH] D156837: [AArch64][CodeGen] Avoid inverting hot branches during relaxation
Daniel Hoekwater via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 16 12:01:25 PDT 2023
dhoekwater marked an inline comment as done.
dhoekwater added inline comments.
================
Comment at: llvm/lib/CodeGen/BranchRelaxation.cpp:406-430
+ if (MBB->getSectionID() != TBB->getSectionID() &&
+ TBB->getSectionID() == MBBSectionID::ColdSectionID &&
+ TrampolineInsertionPoint != nullptr) {
+ // If the insertion point is out of range, we can't put a trampoline there.
+ NewBB =
+ createNewBlockAfter(*TrampolineInsertionPoint, MBB->getBasicBlock());
+
----------------
arsenm wrote:
> Split this into a helper function?
`insertUncondBranch`, `removeBranch`, `insertBranch`, and `finalizeBlockChanges` are function-local lambdas, so moving this all into a helper function would require moving those to helper functions as well.
I think abstracting away BlockInfo maintenance into helper functions could be a good idea, but doing so in this change would probably be overly ambitious.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D156837/new/
https://reviews.llvm.org/D156837
More information about the llvm-commits
mailing list