[Mlir-commits] [mlir] [mlir][loops] Add getters for multi dim loop variables in `LoopLikeOpInterface` (PR #94516)

Oleksandr Alex Zinenko llvmlistbot at llvm.org
Fri Jun 7 02:07:17 PDT 2024


ftynse wrote:

> yah i've definitely been burned by people abusing asserts (using them over proper error checks), so i understand where you're coming from. but hopefully it's agreed that's not the case here. again it's purely for bug catching and not intended as an error check because the assert should never fail unless someone else modifies the code. in which case the assert would help debug

The rule of thumb is: if this can happen on IR that passed the verifier, it should be a diagnostic, otherwise it should be an assertion. Including the case when a downstream didn't implement the interface contract correctly. Asserts are for developers, including downstream developers. Diagnostics / null returns are for compiler users. This PR is using them correctly.

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


More information about the Mlir-commits mailing list