[PATCH] D133896: [AArch64][SME] Add codegen pass to handle ZA state in arm_new_za functions.

David Sherwood via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 21 01:45:56 PDT 2022


david-arm added a comment.

In D133896#3802726 <https://reviews.llvm.org/D133896#3802726>, @aemerson wrote:

> Using an IR pass to implement ABI doesn't seem right to me. This could be done at codegen time, and having it at the IR level places implicit constraints on later IR passes that aren't enforced.
>
> Even the IR pass was the right choice, I don't see anything here that necessitates a Module pass instead of the usual FunctionPass.

Hi @aemerson, I think the reasons why we chose to do this in IR are:

1. Partly due to legacy reasons, since for an earlier version of the ABI it made sense to implement aspects of the ABI in an IR pass. However, I guess there is now a less compelling reason to do so.
2. I think it's probably neater to do this in IR since we can do both the function prologue and epilogue at the same time, otherwise in codegen I imagine we have to do it separately in different lowering functions? In an IR pass we can deal with all aspects of the attributes at the same time in the same function. IIRC it's easier to create/split blocks in IR too?

I can look into how much effort it would take to implement this in codegen, however I'm not sure what you mean by `having it at the IR level places implicit constraints on later IR passes that aren't enforced`? It's worth saying that we will need an SME ABI IR pass like when it comes to exception handling because that's too complicated to do at the codegen level.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D133896



More information about the llvm-commits mailing list