[PATCH] D115360: [MachineVerifier] Undef subreg operands do not require subranges

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 16 01:49:44 PST 2021


This revision was automatically updated to reflect the committed changes.
foad marked an inline comment as done.
Closed by commit rGcce93b339724: [MachineVerifier] Undef subreg operands do not require subranges (authored by foad).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D115360

Files:
  llvm/lib/CodeGen/MachineVerifier.cpp
  llvm/test/CodeGen/AMDGPU/no-remat-indirect-mov.mir


Index: llvm/test/CodeGen/AMDGPU/no-remat-indirect-mov.mir
===================================================================
--- llvm/test/CodeGen/AMDGPU/no-remat-indirect-mov.mir
+++ llvm/test/CodeGen/AMDGPU/no-remat-indirect-mov.mir
@@ -1,5 +1,6 @@
 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
 # RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900  -start-after=phi-node-elimination -stop-before=greedy -o - %s | FileCheck -check-prefix=GFX9 %s
+# RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900  -start-after=phi-node-elimination -stop-before=greedy -early-live-intervals -o - %s | FileCheck -check-prefix=GFX9 %s
 
 # Make sure that the V_MOV_B32 isn't rematerialized out of the loop. This was also breaking RenameIndependentSubregisters which missed the use of all subregisters.
 
Index: llvm/lib/CodeGen/MachineVerifier.cpp
===================================================================
--- llvm/lib/CodeGen/MachineVerifier.cpp
+++ llvm/lib/CodeGen/MachineVerifier.cpp
@@ -2229,8 +2229,8 @@
   if (LiveInts && Reg.isVirtual()) {
     if (LiveInts->hasInterval(Reg)) {
       LI = &LiveInts->getInterval(Reg);
-      if (SubRegIdx != 0 && !LI->empty() && !LI->hasSubRanges() &&
-          MRI->shouldTrackSubRegLiveness(Reg))
+      if (SubRegIdx != 0 && (MO->isDef() || !MO->isUndef()) && !LI->empty() &&
+          !LI->hasSubRanges() && MRI->shouldTrackSubRegLiveness(Reg))
         report("Live interval for subreg operand has no subranges", MO, MONum);
     } else {
       report("Virtual register has no live interval", MO, MONum);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D115360.394790.patch
Type: text/x-patch
Size: 1583 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211216/111ce52d/attachment.bin>


More information about the llvm-commits mailing list