[all-commits] [llvm/llvm-project] 7bc03f: [MachineOutliner][AArch64] WA for multiple stack f...

Puyan Lotfi via All-commits all-commits at lists.llvm.org
Mon Aug 10 12:44:47 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 7bc03f55539f7f081daea5363f2e4845b2e75f57
      https://github.com/llvm/llvm-project/commit/7bc03f55539f7f081daea5363f2e4845b2e75f57
  Author: Puyan Lotfi <puyan at puyan.org>
  Date:   2020-08-10 (Mon, 10 Aug 2020)

  Changed paths:
    M llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
    A llvm/test/CodeGen/AArch64/machine-outliner-2fixup-blr-terminator.mir
    A llvm/test/CodeGen/AArch64/machine-outliner-no-noreturn-no-stack.mir
    A llvm/test/CodeGen/AArch64/machine-outliner-noreturn-no-stack.mir

  Log Message:
  -----------
  [MachineOutliner][AArch64] WA for multiple stack fixup cases in MachineOutliner.

In cases where MachineOutliner candidates either are:

  * noreturn
  * have calls with no available LR or free regs
  * Don't use SP

we can end up hitting stack fixup code for the caller and the callee for
a FrameID of MachineOutlinerDefault. This triggers the assert:

  `assert(OF.FrameConstructionID != MachineOutlinerDefault &&
          "Can only fix up stack references once");`

in AArch64InstrInfo.cpp. This assert exists for now because a lot of the
fixup code is not tested to handle fixing up more than once and needs
some better checks and enhancements to avoid potentially generating
illegal code.

I've filed a Bugzilla report to track this until these cases are handled
by the AArch64 MachineOutliner: https://bugs.llvm.org/show_bug.cgi?id=46767

This diff detects cases that will cause these multiple stack fixups and
prune the Candidates from `RepeatedSequenceLocs`.

    Differential Revision: https://reviews.llvm.org/D83923




More information about the All-commits mailing list