[PATCH] D147721: [AMDGPU] Fix a case of updating LiveIntervals in SIOptimizeExecMaskingPreRA

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 7 03:19:30 PDT 2023


foad updated this revision to Diff 511652.
foad added a comment.

Rebase.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D147721

Files:
  llvm/lib/Target/AMDGPU/SIOptimizeExecMaskingPreRA.cpp


Index: llvm/lib/Target/AMDGPU/SIOptimizeExecMaskingPreRA.cpp
===================================================================
--- llvm/lib/Target/AMDGPU/SIOptimizeExecMaskingPreRA.cpp
+++ llvm/lib/Target/AMDGPU/SIOptimizeExecMaskingPreRA.cpp
@@ -294,7 +294,13 @@
 
       LIS->removeVRegDefAt(*SelLI, SelIdx.getRegSlot());
       LIS->RemoveMachineInstrFromMaps(*Sel);
+      bool ShrinkSel = Sel->getOperand(0).readsReg();
       Sel->eraseFromParent();
+      if (ShrinkSel) {
+        // The result of the V_CNDMASK was a subreg def which counted as a read
+        // from the other parts of the reg. Shrink their live ranges.
+        LIS->shrinkToUses(SelLI);
+      }
     }
   }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D147721.511652.patch
Type: text/x-patch
Size: 692 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230407/f8801a03/attachment.bin>


More information about the llvm-commits mailing list