[PATCH] D124517: [DebugInfo][InstrRef] Use a cache to avoid creating redundant DBG_PHIs

Orlando Cazalet-Hyams via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 29 00:30:37 PDT 2022


Orlando accepted this revision.
Orlando added a comment.
This revision is now accepted and ready to land.

Makes sense, LGTM. I've added two tiny suggestions inline but I don't mind if you leave the patch as it is.



================
Comment at: llvm/include/llvm/CodeGen/MachineFunction.h:534
   /// \p MI The copy-like instruction to salvage.
+  /// \p ArgDbgPHIs A container to cache already-solved COPYs.
   /// \returns An instruction/operand pair identifying the defining value.
----------------
I think something like `DbgPHICache` might be clearer, but this is not a very strong opinion.


================
Comment at: llvm/lib/CodeGen/MachineFunction.cpp:1042
+  // Check whether this copy-like instruction has already been salvaged into
+  // an operand pair.
+  Register Dest;
----------------
Possibly worth adding `assert(MI.isCopyLike())`? Not a strong opinion.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D124517



More information about the llvm-commits mailing list