[PATCH] D124707: [AArch64] Make sure XRay pseudo-instruction sizes are reported correctly

duk via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 30 09:53:08 PDT 2022


duck-37 added a comment.

In D124707#3483805 <https://reviews.llvm.org/D124707#3483805>, @duck-37 wrote:

> Okay, taking this off the review queue until I take a look at the other bug incidentally exposed by fixing this one; the MachineOutliner doesn't properly adjust attributes of new outlined functions with XRay instrumentation opcodes. (should it even run on those at all?)
> As such, what happens is that this check <https://github.com/llvm/llvm-project/blob/23b7e15c675513c53a6d448e6b7cb95d6c1df029/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp#L2188> doesn't pass, meaning `CurrentFnBegin` isn't set, meaning that an assertion failure is thrown when the code generator tries to use it as a symbol when emitting the XRay instrumentation table.
> The reason this testcase didn't fail before is because `AArch64InstrInfo::getOutliningCandidateInfo` uses the sizes of instructions as part of <https://github.com/llvm/llvm-project/blob/23b7e15c675513c53a6d448e6b7cb95d6c1df029/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp#L6842> the outlining heuristic. When the pseudo-opcode sizes were fixed, the heuristic decided it was profitable to outline xray pseudo-instructions, triggering the bug.




Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D124707



More information about the llvm-commits mailing list