[Mlir-commits] [mlir] [mlir] Switch to llvm::cast in generated Op::create() definitions (PR #217845)

Matthias Springer llvmlistbot at llvm.org
Fri Aug 21 01:52:20 PDT 2026


matthias-springer wrote:

> Yet, since llvm::dyn_cast() is used to perform the conversion, it practically means that, even in release builds, there's a branch generated for the case if such conversion fails. 

Why is there a branch? And why is there no branch when using `llvm::cast`?

Your new implementation may pessimize debug builds: two runtime checks are performed, one of `isa` and one for `cast`.


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


More information about the Mlir-commits mailing list