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

Bill Wendling via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 1 16:29:45 PST 2022


void 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);
----------------
arsenm wrote:
> nickdesaulniers wrote:
> > 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
> I think auto is worse in 95% of situations
Okay.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D110869



More information about the llvm-commits mailing list