Fix crash in Spirv -lower-host-to-llvm pass
authorMehdi Amini <joker.eph@gmail.com>
Mon, 16 Jan 2023 20:59:09 +0000 (20:59 +0000)
committerMehdi Amini <joker.eph@gmail.com>
Mon, 16 Jan 2023 21:06:49 +0000 (21:06 +0000)
commitffd3a19e653f9356ec0be65d4e1c38562573f6c7
tree5c20653f5b36a917d30a6e9771db5c06154ee6cc
parentdbbd9070152a2b1a28a1617437c75ed9491932c6
Fix crash in Spirv -lower-host-to-llvm pass

When providing with a spirv module as input where no conversion happens
the code didn't defend against broken invariant.

We'll fail the pass here, but it's not clear if it is the right thing
or if the module should just be ignored.

Fixes #59971

Reviewed By: kuhar

Differential Revision: https://reviews.llvm.org/D141856
mlir/lib/Conversion/SPIRVToLLVM/ConvertLaunchFuncToLLVMCalls.cpp
mlir/test/Conversion/SPIRVToLLVM/lower-host-to-llvm-calls_fail.mlir [new file with mode: 0644]