[all-commits] [llvm/llvm-project] c32cae: [mlir][spirv] Fix crash in FuncOpVectorUnroll for ...

Mehdi Amini via All-commits all-commits at lists.llvm.org
Wed Mar 4 17:06:58 PST 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c32caeec8158d634bb71ab8911a6031248b9fc47
      https://github.com/llvm/llvm-project/commit/c32caeec8158d634bb71ab8911a6031248b9fc47
  Author: Mehdi Amini <joker.eph at gmail.com>
  Date:   2026-03-05 (Thu, 05 Mar 2026)

  Changed paths:
    M mlir/lib/Dialect/SPIRV/Transforms/SPIRVConversion.cpp
    M mlir/test/Conversion/ConvertToSPIRV/func-signature-vector-unroll.mlir

  Log Message:
  -----------
  [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



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list