[PATCH] D89386: [AMDGPU] Fix access beyond the end of the basic block in execMayBeModifiedBeforeAnyUse.

Valery Pykhtin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 22 09:55:22 PDT 2020


vpykhtin marked an inline comment as done.
vpykhtin added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/SIInstrInfo.cpp:7108
 
-  for (auto &UseInst : MRI.use_nodbg_instructions(VReg)) {
+  for (auto &Use : MRI.use_nodbg_operands(VReg)) {
+    auto &UseInst = *Use.getParent();
----------------
arsenm wrote:
> Why change to the uses instead of instructions?
This is the core problem. instructions aren't guaranteed to be unique on iteration depending on the order of uses in use-def list for a register. See the unittest below that shows how this can happen.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D89386



More information about the llvm-commits mailing list