[PATCH] D134940: [AArch64][SME] Prevent SVE object address calculations between smstop and call

David Sherwood via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 30 01:57:10 PDT 2022


david-arm created this revision.
david-arm added reviewers: sdesmalen, aemerson, kmclaughlin, paulwalker-arm.
Herald added subscribers: ctetreau, hiraditya, kristof.beyls, tschuett.
Herald added a project: All.
david-arm requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This patch introduces a new AArch64 ISD node (OBSCURE_COPY) that can
be used when we want to prevent SVE object address calculations
from being rematerialised between a smstop/smstart and a call.
At the moment we use COPY to copy the frame index to a register,
which leads to problems because the "simple register coalescing"
pass understands the COPY instruction and attempts to rematerialise
an address calculation with 'addvl' between an smstop and a call.
When in streaming mode the 'addvl' instruction may have different
behaviour because the streaming SVE vector length is not guaranteed
to equal the normal SVE vector length.

The new ISD opcode OBSCURE_COPY gets lowered to a new pseudo
instruction also called OBSCURE_COPY. This ensures it cannot be
rematerialised and we expand this into a simple move very late in
the machine instruction pipeline.

A new test is added here:

  CodeGen/AArch64/sme-streaming-interface.ll


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D134940

Files:
  llvm/lib/Target/AArch64/AArch64ExpandPseudoInsts.cpp
  llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
  llvm/lib/Target/AArch64/AArch64ISelLowering.h
  llvm/lib/Target/AArch64/AArch64SMEInstrInfo.td
  llvm/test/CodeGen/AArch64/sme-streaming-interface.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D134940.464182.patch
Type: text/x-patch
Size: 6134 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220930/d4ac8c2c/attachment.bin>


More information about the llvm-commits mailing list