[llvm] [mlir] [MLIR][OpenMP][OMPIRBuilder] Error propagation across callbacks (PR #112533)

Michael Kruse via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 17 03:28:22 PDT 2024


Meinersbur wrote:

I think continuing on an unrecoverable error is an inherently bad idea. It will create code paths that will never be tested by definition (because if there is a path we will fix the bug leading to that path) and hence likely cause dereferenced null pointers, trigger assertions, etc already because the LLVM generated so far is not in an expected state. For instance, the new early abort in `createTaskgroup` may leave a degenerate BB, any call to `BB::getTerminator()` will return nullptr, and at latest the IR-verifier will crash.  Any `llvm_unreachable` and `assert` in OpenMPIRBuilder and elsewhere will also still cause a crash, not `mlir::emitError` which seems inconsequential.

However, of course I will not stand in the way if this is the community-chosen solution and/or established pattern. Also, if there is use case with a recoverable error we would need this as well.

https://github.com/llvm/llvm-project/pull/112533


More information about the llvm-commits mailing list