-
Notifications
You must be signed in to change notification settings - Fork 14.3k
MachineVerifier: Print name of failing subregister index #129491
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MachineVerifier: Print name of failing subregister index #129491
Conversation
@llvm/pr-subscribers-backend-amdgpu Author: Matt Arsenault (arsenm) ChangesI'm not sure of a good example to test the "does not fully support" Full diff: https://github.com/llvm/llvm-project/pull/129491.diff 2 Files Affected:
diff --git a/llvm/lib/CodeGen/MachineVerifier.cpp b/llvm/lib/CodeGen/MachineVerifier.cpp
index 4ab6fc2ddc28c..87d3033038414 100644
--- a/llvm/lib/CodeGen/MachineVerifier.cpp
+++ b/llvm/lib/CodeGen/MachineVerifier.cpp
@@ -2749,13 +2749,15 @@ MachineVerifier::visitMachineOperand(const MachineOperand *MO, unsigned MONum) {
if (!SRC) {
report("Invalid subregister index for virtual register", MO, MONum);
OS << "Register class " << TRI->getRegClassName(RC)
- << " does not support subreg index " << SubIdx << '\n';
+ << " does not support subreg index "
+ << TRI->getSubRegIndexName(SubIdx) << '\n';
return;
}
if (RC != SRC) {
report("Invalid register class for subregister index", MO, MONum);
OS << "Register class " << TRI->getRegClassName(RC)
- << " does not fully support subreg index " << SubIdx << '\n';
+ << " does not fully support subreg index "
+ << TRI->getSubRegIndexName(SubIdx) << '\n';
return;
}
}
diff --git a/llvm/test/MachineVerifier/AMDGPU/unsupported-subreg-index.mir b/llvm/test/MachineVerifier/AMDGPU/unsupported-subreg-index.mir
new file mode 100644
index 0000000000000..80631fdcdda3e
--- /dev/null
+++ b/llvm/test/MachineVerifier/AMDGPU/unsupported-subreg-index.mir
@@ -0,0 +1,15 @@
+# RUN: not --crash llc -mtriple=amdgcn -mcpu=gfx900 -run-pass=none -o /dev/null %s 2>&1 | FileCheck %s
+
+---
+name: unsupported_subreg_index
+body: |
+ bb.0:
+ liveins: $vgpr0_vgpr1, $sgpr0_sgpr1, $agpr0_agpr1_agpr2_agpr3
+
+ ; CHECK: *** Bad machine code: Invalid subregister index for virtual register ***
+ undef %0.sub3:vreg_96 = COPY $vgpr0
+
+ ; CHECK: *** Bad machine code: Invalid subregister index for virtual register ***
+ $vgpr0 = COPY %0.sub3
+
+...
|
Maybe ARM's |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
28311dc
to
f0b59cd
Compare
I'm not sure of a good example to test the "does not fully support" case.
f0b59cd
to
9d8a1ed
Compare
I'm not sure of a good example to test the "does not fully support" case.
I'm not sure of a good example to test the "does not fully support"
case.