| Issue |
240007
|
| Summary |
[mlir][VectorToLLVM] lowering `vector.deinterleave` on a `vector<...index>` creates illegal LLVM IR
|
| Labels |
mlir
|
| Assignees |
|
| Reporter |
pingshiyu
|
Reproduced with the optimized LLVM Git `main` build at fb288ec4774f8664b165f6e302db5be8b30a41da from 04/Nov/2026.
This program is valid and passes verification without any lowerings:
```mlir
module {
func.func @f() -> index {
%v = arith.constant dense<[0, 1]> : vector<2xindex>
%even, %odd = vector.deinterleave %v : vector<2xindex> -> vector<1xindex>
%r = vector.extract %odd[0] : index from vector<1xindex>
return %r : index
}
}
```
```sh
mlir-opt test.mlir -o /dev/null
mlir-opt test.mlir --convert-vector-to-llvm -o /dev/null
```
The first command succeeds. The second command (vector to LLVM lowering) fails verification after `--convert-vector-to-llvm` creates:
```mlir
"llvm.shufflevector"(%converted, %poison)
: (vector<2xi64>, vector<2xindex>) -> vector<1xi64>
```
The converted source operand has type `vector<2xi64>`, while the poison operand still has the original `vector<2xindex>` type. Both operands of `llvm.shufflevector` should have the converted LLVM-compatible type.
## LLM-Suggested Cause and Fix
In `VectorDeinterleaveOpLowering`, `adaptor.getSource()` has already been converted to `vector<2xi64>`, but the fixed-vector path creates its poison second operand with `LLVM::PoisonOp::create(rewriter, loc, sourceType)`, where `sourceType` is the original `vector<2xindex>` type.
The poison should use the converted source/adaptor type, for example `adaptor.getSource().getType()`, rather than the pre-conversion type. A regression test should cover fixed-size `vector.deinterleave` with `index` elements and check that both `llvm.shufflevector` operands use the converted integer vector type.
## LLM Declaration
LLM was used to prepare the bug report, and the bug itself was found and verified by a human.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs