[PATCH] D98716: [NFC][CodeGen] Separate TargetRegisterInfo needsStackRealignment and canRealignStack

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 29 14:57:28 PDT 2021


arsenm added a comment.

In D98716#2652931 <https://reviews.llvm.org/D98716#2652931>, @tmatheson wrote:

>> needsStackRealignment feels too strong given that the target can say we're not realigning the stack anyway. How about something like hasImpliedStackRealignment? And a partner function to call both called something like hasStackRealignment? And a partner function to call both called something like hasStackRealignment?
>
> How about the following naming?
>
> - `shouldRealignStack` - true if there is any reason the stack should be realigned
> - `canRealignStack` - true if we are still able to realign the stack (e.g. we can still reserve/have reserved a frame pointer)
> - `hasStackRealignment = shouldRealignStack && canRealignStack` (not target customisable, for now at least)
>
> Then targets are free to error on `shouldRealignStack && !canRealignStack` if appropriate, or ignore/work around it.

Seems reasonable


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D98716



More information about the llvm-commits mailing list