[PATCH] D133900: [AArch64][SME] Set up a lazy-save/restore around calls.

Amara Emerson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 20 08:22:10 PDT 2022


aemerson added inline comments.


================
Comment at: llvm/lib/Target/AArch64/AArch64ExpandPseudoInsts.cpp:889
+  MIB.addReg(MI.getOperand(1).getReg(), RegState::Implicit);
+  for (unsigned i = 2; i < MI.getNumOperands(); ++i)
+    MIB.add(MI.getOperand(i));
----------------
nit: coding style is to use `I` not `i`.


================
Comment at: llvm/lib/Target/AArch64/AArch64ISelLowering.cpp:5851-5862
+static bool requiresLazySave(const Function &F) {
+  SMEAttrs CallerAttrs(F);
+  if (!CallerAttrs.hasZAState())
+    return false;
+
+  for (const BasicBlock &BB : F)
+    for (const Instruction &I : BB)
----------------
Document this? This looks like an expensive function.

 It also has an unfortunate naming clash with `SMEAttrs::requiresLazySave()`, I think it could be named more descriptively to avoid confusion.


================
Comment at: llvm/lib/Target/AArch64/AArch64MachineFunctionInfo.h:186
+  /// This value is used during ISelLowering.
+  unsigned LazySaveBufferReg = 0;
+
----------------
We have `Register` to represent registers.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D133900



More information about the llvm-commits mailing list