[PATCH] D63803: [PowerPC] Move TOC save to prologue when profitable

Hal Finkel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 25 19:51:01 PDT 2019


hfinkel added inline comments.


================
Comment at: llvm/lib/Target/PowerPC/PPCFrameLowering.cpp:447
 
+static bool MustSaveTOC(const MachineFunction &MF) {
+  const PPCFunctionInfo *FI = MF.getInfo<PPCFunctionInfo>();
----------------
You've introduced this function, which contains two lines of code, and then make a Boolean variable in several later places with the same name. I recommend just moving this code into its caller below and eliminating any potential confusion.


================
Comment at: llvm/lib/Target/PowerPC/PPCFrameLowering.cpp:1314
 
+      if (Reg == PPC::X2 || Reg == PPC::R2)
+        continue;
----------------
Need a MustSaveTOC check here?


================
Comment at: llvm/lib/Target/PowerPC/PPCMIPeephole.cpp:229
+  // we can just do the save in the prologue.
+  if (!MFI.hasVarSizedObjects() &&
+      (CurrBlockFreq > EntryFreq || MPDT->dominates(MI->getParent(), Entry)))
----------------
Why the MFI.hasVarSizedObjects() check?


Repository:
  rL LLVM

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

https://reviews.llvm.org/D63803





More information about the llvm-commits mailing list