This patch turns on the prof branch_weights metadata consistency check in SwitchInstProfUpdateWrapper.
If this patch causes a failure then please before reverting do report the IR that hits the assertion and try identifying the pass that introduces the inconsistency. We have to fix all such passes.
See also the upcoming change D61179 in the Verifier.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
What types of testing has been done ? I assume the code base now is relatively clean so it is safe to turn this on by default?
Frankly speaking I'm not 100% sure that the code is safe. There could be projects that might hit the assertion. E.g I have to fix one pass internally at Azul. I tested LLVM monorepo make check-all and our Azul Zing test suits. So, I believe that the only way to find issues is to land this check D64061 and the verifyer D61179 one by one with some reasonable interval (one week?).
my test hit some other unrelated debug assert. Can you first change the debug assert into error message so that there is no need to use assert enabled build to test the option?
Changed assert(false) to llvm_unreachable() for release builds to fail on inconsistencies. Though it seems to be too strict as the code can tolerate such inconsistencies.