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

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 1 16:22:03 PST 2022


arsenm added inline comments.


================
Comment at: llvm/lib/CodeGen/PrologEpilogInserter.cpp:1259
+
+        for (const MCPhysReg &SReg :
+             TRI.sub_and_superregs_inclusive(MO.getReg()))
----------------
No reference


================
Comment at: llvm/lib/CodeGen/PrologEpilogInserter.cpp:1269
+  const TargetFrameLowering &TFI = *MF.getSubtarget().getFrameLowering();
+  for (auto RestoreBlock : RestoreBlocks)
+    TFI.emitZeroCallUsedRegs(RegsToZero, *RestoreBlock);
----------------
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


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