[PATCH] D69358: AMDGPU: Fix the broken dominator tree

Changpeng Fang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 23 14:49:18 PDT 2019


cfang created this revision.
cfang added a reviewer: arsenm.
Herald added subscribers: t-tye, tpr, dstuttard, yaxunl, nhaehnle, wdng, jvesely, kzhuravl.

In loadSRsrcFromVGPR, if MBB is the same as Succ, Remiander is not the  immediate dominator of Succ.

Still working on  to simplify the LIT test case.


https://reviews.llvm.org/D69358

Files:
  lib/Target/AMDGPU/SIInstrInfo.cpp


Index: lib/Target/AMDGPU/SIInstrInfo.cpp
===================================================================
--- lib/Target/AMDGPU/SIInstrInfo.cpp
+++ lib/Target/AMDGPU/SIInstrInfo.cpp
@@ -4451,12 +4451,12 @@
   // Update dominators. We know that MBB immediately dominates LoopBB, that
   // LoopBB immediately dominates RemainderBB, and that RemainderBB immediately
   // dominates all of the successors transferred to it from MBB that MBB used
-  // to dominate.
+  // to immediately dominate.
   if (MDT) {
     MDT->addNewBlock(LoopBB, &MBB);
     MDT->addNewBlock(RemainderBB, LoopBB);
     for (auto &Succ : RemainderBB->successors()) {
-      if (MDT->dominates(&MBB, Succ)) {
+      if (&MBB != Succ && MDT->dominates(&MBB, Succ)) {
         MDT->changeImmediateDominator(Succ, RemainderBB);
       }
     }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D69358.226186.patch
Type: text/x-patch
Size: 816 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191023/5692a1a1/attachment.bin>


More information about the llvm-commits mailing list