[PATCH] D52829: [AArch64] Fix verifier error when outlining indirect calls

Oliver Stannard via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 3 05:31:54 PDT 2018


olista01 created this revision.
olista01 added a reviewer: jpaquette.
Herald added a reviewer: javed.absar.
Herald added a subscriber: kristof.beyls.

The MachineOutliner for AArch64 transforms indirect calls into indirect
tail calls, replacing the call with the TCRETURNri pseudo-instruction.
This pseudo lowers to a BR, but has the isCall and isReturn flags set.

The problem is that TCRETURNri takes a tcGPR64 as the register argument,
to prevent indiret tail-calls from using caller-saved registers. The
indirect calls transformed by the outliner could use caller-saved
registers.  This is fine, because the outliner ensures that the register
is available at all call sites. However, this causes a verifier failure
when the register is not in tcGPR64. The fix is to add a new
pseudo-instruction like TCRETURNri, but which accepts any GPR.


Repository:
  rL LLVM

https://reviews.llvm.org/D52829

Files:
  lib/Target/AArch64/AArch64AsmPrinter.cpp
  lib/Target/AArch64/AArch64InstrInfo.cpp
  lib/Target/AArch64/AArch64InstrInfo.td
  test/CodeGen/AArch64/machine-outliner-thunk.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52829.168104.patch
Type: text/x-patch
Size: 4411 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181003/dad51ab3/attachment.bin>


More information about the llvm-commits mailing list