llvm-project
9248d195 - [mlir][LLVM] Fix verifier crash for llvm.blockaddress with missing function (#181519)

Commit
3 days ago
[mlir][LLVM] Fix verifier crash for llvm.blockaddress with missing function (#181519) ### Whats the Problem Fix verifier crash in `llvm.blockaddress` when the referenced function symbol is missing by guarding null before `dyn_cast`. Adds regression test using `-verify-diagnostics` to ensure invalid IR emits an error instead of aborting. ### Why it happened `SymbolTable::lookupNearestSymbolFrom` may return null, and `dyn_cast` on a non-existent value triggers an assertion in `mlir-opt`. ### Whats the Fix Split symbol lookup returning early if lookup fails or symbol is not an `LLVMFuncOp`. Verifier now reports “expects an existing block label target” instead of hitting `dyn_cast` assert. Fixes #181451
Author
Parents
Loading