[PATCH] D114545: [CodeGen] Async unwind - add a pass to fix CFI information

Jessica Clarke via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 8 07:55:27 PST 2021


jrtc27 added a comment.

In D114545#3179495 <https://reviews.llvm.org/D114545#3179495>, @chill wrote:

> In D114545#3157219 <https://reviews.llvm.org/D114545#3157219>, @jrtc27 wrote:
>
>> This seems like it should be a generic pass conditionally added (when supported, until all backends support it) by TargetPassConfig with TRI/TLI/etc hooks, not something each target needs to subclass and manually add to the pass order
>
> If that target specific functionality was needed by multiple separate passes, I would consider using hooks. While technically possible in this  case, I fail to see
> any advantage in doing so.

I'm not aware of //any// passes that apply to all targets and follow the model of requiring you to subclass them rather than using TLI/TRI/TFI hooks? This pass is very similar in its model to PrologEpilogInserter, which uses TFI hooks, not subclassing. I would expect this to follow the same approach. It's certainly much easier to use from a backend author's perspective, less boilerplate needed, you just implement the hooks in your TFI and, at least for now, opt in via a bool or bool-returning method in your TFI, and that's it. No new files, no messing with TM to add your pass, no target-specific name for the pass that gets annoying when running tests/using -debug-only/etc, ...


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

https://reviews.llvm.org/D114545



More information about the llvm-commits mailing list