Skip to content

[mlir][vector] Disable from_elements for scalable vectors #117868

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion mlir/include/mlir/Dialect/Vector/IR/VectorOps.td
Original file line number Diff line number Diff line change
Expand Up @@ -806,10 +806,12 @@ def Vector_FromElementsOp : Vector_Op<"from_elements", [
// [[[%f1, %f2]], [[%f3, %f4]], [[%f5, %f6]]]
%3 = vector.from_elements %f1, %f2, %f3, %f4, %f5, %f6 : vector<3x1x2xf32>
```

Note, scalable vectors are not supported.
}];

let arguments = (ins Variadic<AnyType>:$elements);
let results = (outs AnyVectorOfAnyRank:$result);
let results = (outs AnyFixedVectorOfAnyRank:$result);
let assemblyFormat = "$elements attr-dict `:` type($result)";
let hasCanonicalizer = 1;
}
Expand Down
8 changes: 8 additions & 0 deletions mlir/test/Dialect/Vector/invalid.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -1803,6 +1803,14 @@ func.func @invalid_from_elements(%a: f32, %b: i32) {

// -----

func.func @invalid_from_elements_scalable(%a: f32, %b: i32) {
// expected-error @+1 {{'result' must be fixed-length vector of any type values, but got 'vector<[2]xf32>'}}
vector.from_elements %a, %b : vector<[2]xf32>
return
}

// -----

func.func @invalid_step_0d() {
// expected-error @+1 {{vector.step' op result #0 must be vector of index values of ranks 1, but got 'vector<f32>'}}
vector.step : vector<f32>
Expand Down