[Mlir-commits] [mlir] [mlir][vector] Allow signless integer element types in `vector.step` (PR #205142)
Victor Perez
llvmlistbot at llvm.org
Wed Jun 24 08:25:17 PDT 2026
================
@@ -1756,6 +1756,25 @@ func.func @step() -> vector<4xindex> {
return %0 : vector<4xindex>
}
+// CHECK-LABEL: @step_i8
+// CHECK: %[[CST:.+]] = arith.constant dense<[0, 1, 2, 3]> : vector<4xi8>
+// CHECK: return %[[CST]] : vector<4xi8>
+func.func @step_i8() -> vector<4xi8> {
+ %0 = vector.step : vector<4xi8>
+ return %0 : vector<4xi8>
+}
+
+// The sequence wraps past the i8 limit, so lane values are truncated. The
+// constant is printed as a hex blob ending in `...FEFF0001`: after 255 (`FF`)
+// the values restart at 0 (`00`) and 1 (`01`).
+// CHECK-LABEL: @step_i8_truncate
+// CHECK: %[[CST:.+]] = arith.constant dense<"0x0001{{.*}}FEFF0001"> : vector<258xi8>
+// CHECK: return %[[CST]] : vector<258xi8>
+func.func @step_i8_truncate() -> vector<258xi8> {
+ %0 = vector.step : vector<258xi8>
+ return %0 : vector<258xi8>
+}
+
----------------
victor-eds wrote:
Sure, let's wait till we decide on the lowering and I take on it.
https://github.com/llvm/llvm-project/pull/205142
More information about the Mlir-commits
mailing list