[PATCH] D130622: [AMDGPU][SIFoldOperands] Clear kills when folding COPY

Carl Ritson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 27 20:01:13 PDT 2022


critson marked 2 inline comments as done.
critson added a comment.

In D130622#3682499 <https://reviews.llvm.org/D130622#3682499>, @foad wrote:

>>> I wonder why we never normally see this in practice?
>>
>> I think we only go into this code if there is a COPY of the result of another COPY. Perhaps these are normally copy-propagated by some other pass before we get here?
>
> See: https://reviews.llvm.org/D52577#1248697 which introduced this code, and the comment: "Why is this necessary? PeepholeOpt runs first and should have eliminated redundant copies"

In my specific case these extra COPYs come from SILoadStoreOptimizer.



================
Comment at: llvm/lib/Target/AMDGPU/SIFoldOperands.cpp:741-743
+      for (auto &Use : MRI->use_operands(OpToFold.getReg())) {
+        Use.setIsKill(false);
+      }
----------------
arsenm wrote:
> foad wrote:
> > Don't need the braces.
> You've reinvented MRI.clearKillFlags
Thanks, I had missed there was a helper for this.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D130622



More information about the llvm-commits mailing list