Copy the asserts from the printing code, and turn them into actual verifier rules. Doing this revealed an existing bug - see D133868.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
@reames what's your thinking about the current asserts in the printing code - to keep them, or not?
I think it definitely makes sense to add these verifier rules and the code seems like an accurate translation from the printing code to my eyes. I'd appreciate if someone else a little more familiar with the vector instructions would give a quick additional review, but otherwise LGTM.
llvm/lib/Target/RISCV/RISCVInstrInfo.cpp | ||
---|---|---|
1224 | MI.getDesc() here should be the same as Desc 2 lines up. But it looks like we took the long way to create Desc at the top of this function. |
Had not planned to remove them. A data point is that the verifier does not use that printing path, so having them doesn't influence verification failures.
llvm/lib/Target/RISCV/RISCVInstrInfo.cpp | ||
---|---|---|
1224 | Will reuse, update pending. |
MI.getDesc() here should be the same as Desc 2 lines up. But it looks like we took the long way to create Desc at the top of this function.