[PATCH] D64393: [AMDGPU] Fix DPP combiner check for exec modification

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 10 13:52:38 PDT 2019


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


================
Comment at: llvm/lib/Target/AMDGPU/SIInstrInfo.cpp:6103-6106
+  auto E = UseMI->getIterator();
+  for (auto I = std::next(DefMI.getIterator()); I != E; ++I) {
+    if (I->isDebugInstr())
+      continue;
----------------
arsenm wrote:
> This should probably be a backwards scan, but that can be a separate change
What's the advantage?


================
Comment at: llvm/lib/Target/AMDGPU/SIInstrInfo.cpp:6144-6145
 
-  // Stop scan at the use if known.
-  auto E = UseMI ? UseMI->getIterator() : DefBB->end();
-  for (auto I = std::next(DefMI.getIterator()); I != E; ++I) {
+  // Stop scan when we have seen all the uses.
+  for (auto I = std::next(DefMI.getIterator()); !Uses.empty(); ++I) {
     if (I->isDebugInstr())
----------------
arsenm wrote:
> Why is this erasing the use as it iterates?
So we can exit the loop when Uses.empty().


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D64393





More information about the llvm-commits mailing list