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

Jeremy Morse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 3 01:55:44 PDT 2022


jmorse marked 2 inline comments as done.
jmorse added inline comments.


================
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.
----------------
Orlando wrote:
> I think something like `DbgPHICache` might be clearer, but this is not a very strong opinion.
Sounds good,


================
Comment at: llvm/lib/CodeGen/MachineFunction.cpp:1042
+  // Check whether this copy-like instruction has already been salvaged into
+  // an operand pair.
+  Register Dest;
----------------
Orlando wrote:
> Possibly worth adding `assert(MI.isCopyLike())`? Not a strong opinion.
IMHO no, there are assertions down both sides of the branch below that are effectively that assertion.


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