[PATCH] D134366: MachineVerifier: Verify REG_SEQUENCE
Quentin Colombet via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 21 09:59:38 PDT 2022
qcolombet accepted this revision.
qcolombet added a comment.
This revision is now accepted and ready to land.
Good catch @arsenm!
Overall LGTM. Just one missing case if I'm not mistaken.
================
Comment at: llvm/lib/CodeGen/MachineVerifier.cpp:1940
+ MI->getOperand(I + 1).getImm() == 0 ||
+ MI->getOperand(I + 1).getImm() >= TRI->getNumSubRegIndices()) {
+ report("Invalid subregister index operand for REG_SEQUENCE",
----------------
Nit: For compactness, I would put `MI->getOperand(I + 1)` in its own variable.
================
Comment at: llvm/test/MachineVerifier/verify-reg-sequence.mir:14
+ ; CHECK: *** Bad machine code: Too few operands ***
+ REG_SEQUENCE
+
----------------
I think we miss a case in the test and in the verifier:
```
%val = REG_SEQUENCE <noOperands>
```
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D134366/new/
https://reviews.llvm.org/D134366
More information about the llvm-commits
mailing list