[Mlir-commits] [mlir] [mlir][VectorToSPIRV] Add conversion for vector.extract with dynamic indices (PR #114137)
Jakub Kuderski
llvmlistbot at llvm.org
Tue Nov 5 07:07:17 PST 2024
================
@@ -169,9 +154,17 @@ struct VectorExtractOpConvert final
return success();
}
- int32_t id = getFirstIntValue(extractOp.getMixedPosition());
- rewriter.replaceOpWithNewOp<spirv::CompositeExtractOp>(
- extractOp, adaptor.getVector(), id);
+ std::optional<int64_t> id =
+ getConstantIntValue(extractOp.getMixedPosition()[0]);
+
+ if (id.has_value())
----------------
kuhar wrote:
```suggestion
if (std::optional<int64_t> id =
getConstantIntValue(extractOp.getMixedPosition()[0]);)
```
you could do this
https://github.com/llvm/llvm-project/pull/114137
More information about the Mlir-commits
mailing list