[PATCH] D110869: [X86] Implement -fzero-call-used-regs option

Nick Desaulniers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 1 12:41:38 PST 2022


nickdesaulniers added inline comments.


================
Comment at: llvm/lib/CodeGen/PrologEpilogInserter.cpp:1269
+  const TargetFrameLowering &TFI = *MF.getSubtarget().getFrameLowering();
+  for (auto RestoreBlock : RestoreBlocks)
+    TFI.emitZeroCallUsedRegs(RegsToZero, *RestoreBlock);
----------------
void wrote:
> nickdesaulniers wrote:
> > ```
> > for (MachineBasicBlock *RestoreBlock : RestoreBlocks)
> > ```
> I prefer `auto` unless absolutely necessary (or to avoid confusion).
What does the style guide say?
https://llvm.org/docs/CodingStandards.html#use-auto-type-deduction-to-make-code-more-readable
> Don’t “almost always” use auto

At the very least you aught to use `auto *` here rather than `auto`.
https://llvm.org/docs/CodingStandards.html#beware-unnecessary-copies-with-auto


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D110869



More information about the cfe-commits mailing list