This assertion should hold for any reasonable data flow algorithm, but is known not to in several cases today. I'd like to go ahead and land this off-by-default, so that we can collaborate on fixes and have a common definition of success.
Details
Diff Detail
Event Timeline
When I split this out of another patch set, I apparently missed updating the assert. This assert only holds if we encountered an instruction which needs a state, otherwise we have an uninitialized current state. Updated diff forthcoming.
llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp | ||
---|---|---|
1188 | printMBBReference might be better since getName returns an empty string if there's no IR BB? |
llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp | ||
---|---|---|
1193 | Sorry - last minute comment. Maybe an assertion message would help people report issues to us more easily. |
Address review comment
(If you want particular wording on the assert message, include it in a comment and I'll change before landing.)
This has landed. I got the tag wrong in the commit message so the auto-close didn't kick in.
commit f486119ce94573793c1569f1542c09fae74a0d1d
Author: Philip Reames <preames@rivosinc.com>
Date: Thu May 5 12:50:47 2022 -0700
[riscv] Add strict asserts for VSETVLI insertion algorithm to help catch bugs This assertion should hold for any reasonable data flow algorithm, but is known not to in several cases today. I'd like to go ahead and land this off-by-default, so that we can collaborate on fixes and have a common definition of success. Differential: https://reviews.llvm.org/D125035
printMBBReference might be better since getName returns an empty string if there's no IR BB?