[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 9 06:07:27 PST 2021
foad updated this revision to Diff 393134.
foad added a comment.
Only ignore undef uses, not undef defs.
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.393134.patch
Type: text/x-patch
Size: 1583 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211209/f37e6eb1/attachment.bin>
More information about the llvm-commits
mailing list