llvm-project
c32caeec - [mlir][spirv] Fix crash in FuncOpVectorUnroll for dynamic-shaped tensor args (#184626)

Commit
54 days ago
[mlir][spirv] Fix crash in FuncOpVectorUnroll for dynamic-shaped tensor args (#184626) FuncOpVectorUnroll::matchAndRewrite iterates over all function arguments and creates a zero-constant placeholder for any non-vector argument via rewriter.getZeroAttr(type). For dynamically-shaped tensor types such as tensor<?x2xi8>, getZeroAttr ultimately calls DenseIntOrFPElementsAttr::getRaw which asserts that the type has a static shape. Add an early pre-check that returns failure() for any non-vector argument with a dynamically-shaped type. This must be done before any IR modifications are made, since returning failure() after inlining the function body would leave the IR in an inconsistent state. Fixes #148369
Author
Parents
Loading