Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions llvm/lib/CodeGen/MachineVerifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3035,6 +3035,13 @@ void MachineVerifier::checkLiveness(const MachineOperand *MO, unsigned MONum) {

if (llvm::is_contained(TRI->subregs(MOP.getReg()), Reg))
Bad = false;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Above is_contained still redundant?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, thanks for the reminder. Dropped.

if (MOP.getReg() != Reg &&
all_of(TRI->regunits(Reg), [&](const MCRegUnit RegUnit) {
return llvm::is_contained(TRI->regunits(MOP.getReg()),
RegUnit);
}))
Bad = false;
}
}
if (Bad)
Expand Down
21 changes: 21 additions & 0 deletions llvm/test/MachineVerifier/RISCV/subreg-liveness.mir
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 5
# RUN: llc -mtriple=riscv64 -mattr=+v -run-pass=none %s -o - | FileCheck %s

...
---
name: func
tracksRegLiveness: true
tracksDebugUserValues: true
body: |
bb.0:
liveins: $v0, $v8, $v9, $v10, $v11
; CHECK-LABEL: name: func
; CHECK: liveins: $v0, $v8, $v9, $v10, $v11
; CHECK-NEXT: {{ $}}
; CHECK-NEXT: renamable $v16m2 = PseudoVMV_V_I_M2 undef renamable $v16m2, 0, -1, 3 /* e8 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
; CHECK-NEXT: $v20m2 = VMV2R_V $v14m2, implicit $v12_v13_v14_v15_v16
renamable $v16m2 = PseudoVMV_V_I_M2 undef renamable $v16m2, 0, -1, 3 /* e8 */, 0 /* tu, mu */, implicit $vl, implicit $vtype
$v20m2 = VMV2R_V $v14m2, implicit $v12_v13_v14_v15_v16
...
Loading