[Mlir-commits] [mlir] [mlir] Implement inferResultRanges for vector.step op (PR #151536)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Thu Jul 31 09:23:22 PDT 2025
================
@@ -7197,6 +7197,31 @@ Value mlir::vector::makeArithReduction(OpBuilder &b, Location loc,
return selectPassthru(b, mask, result, acc);
}
+//===----------------------------------------------------------------------===//
+// StepOp
+//===----------------------------------------------------------------------===//
+
+void StepOp::inferResultRanges(ArrayRef<ConstantIntRanges> argRanges,
+ SetIntRangeFn setResultRanges) {
+ auto resultType = cast<VectorType>(getType());
+ if (resultType.isScalable()) {
+ return;
+ }
+ std::optional<ConstantIntRanges> result;
+ Type elementType = resultType.getElementType();
+ unsigned bitwidth = elementType.isIndex()
+ ? IndexType::kInternalStorageBitWidth
+ : elementType.getIntOrFloatBitWidth();
+ int64_t size = resultType.getShape()[0];
+ for (int64_t val : llvm::seq<int64_t>(size)) {
----------------
Max191 wrote:
Oh, right... not sure why I did it like that.
https://github.com/llvm/llvm-project/pull/151536
More information about the Mlir-commits
mailing list