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

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 24 05:44:41 PDT 2021


arsenm added inline comments.


================
Comment at: llvm/include/llvm/CodeGen/TargetRegisterInfo.h:917
   /// aligned more than the normal calling convention calls for.
-  /// This cannot be overriden by the target, but canRealignStack can be
-  /// overridden.
-  bool needsStackRealignment(const MachineFunction &MF) const;
+  virtual bool needsStackRealignment(const MachineFunction &MF) const;
 
----------------
I've found this pair of functions confusing before. I think the naming and having to call both in most situations is still confusing. I'm also not sure why this is in TargetRegisterInfo, and not TargetFrameLowering.

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?


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