-
Notifications
You must be signed in to change notification settings - Fork 261
IR printing (-print-ir-after-all) crash #182
Comments
I'd expect a developer to print the generic IR when debugging though. |
The main way that we can be resilient is to print the generic form of the operation. The main problem is that for debugging when passes generate invalid IR, it's difficult for us to preemptively know that. I've got a PR in review that always prints the generic form on pass failure, but that won't solve the crash here because the verifier is the pass that is failing; Not the one actually generating invalid IR(LLVMLoweringPass). There are a couple solutions:
Each of these have tradeoffs. 1) isn't desirable IMO given the other two options (see Mehdi's comment). 2) can be used immediately. 3) requires adding additional support to the IR printing instrumentation. Just a note, but the core IR printer generally is resilient to invalid IR. The pretty/custom printers are not and will never be resilient. |
Yes, but that would crash as well here (?). |
Sorry, -mlir-print-op-generic does work here. But I'd expect a developer to print the custom form (readability) even while debugging. I for one never use the long form in MLIR for debugging - very rarely do I find it useful. |
Thanks very much for the detail. The second option sounds satisfactory to me.
Thanks. |
Can we close this? |
The IR printer is expected to be resilient to invalid IR and -print-ir-after-all should never crash on a test case that didn't crash without it (because a developer wouldn't be able to see what's wrong).
does not crash (it just fails verification), but
The text was updated successfully, but these errors were encountered: