[Mlir-commits] [mlir] [mlir][vector] Fix crash in vector.from_elements folding with poison values (PR #158528)

Andrzej WarzyƄski llvmlistbot at llvm.org
Mon Sep 15 01:41:36 PDT 2025


banach-space wrote:

Thanks for the fix!

> I'm wondering if we could fix this in another way:
> 
> 1. Change the parameter type of `convertIntegerAttr` to `IntegerAttr`.
> 2. Expand the `!attr` check at the beginning of `foldFromElementsToConstant` to handle poison attrs.
> 
> Given that the function name is already **convertIntegerAttr**, it seems like ensuring the type should be the caller's responsibility.

+1

On a related note:
* lets try to keep all tests for `foldFromElementsToConstant` grouped together,
* lets use the prefix `@negative_` to label negative tests.

For more details: https://mlir.llvm.org/getting_started/TestingGuide/

We seem to have already diverged a bit with tests for `foldFromElementsToConstant`, here's a fix:
* https://github.com/llvm/llvm-project/pull/158578

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


More information about the Mlir-commits mailing list