[Mlir-commits] [mlir] [mlir][vector]add foldConstantOp fold function and apply it to extractOp and insertOp. (PR #124399)
lonely eagle
llvmlistbot at llvm.org
Mon Jan 27 22:12:25 PST 2025
================
@@ -1999,6 +2041,9 @@ OpFoldResult ExtractOp::fold(FoldAdaptor) {
return val;
if (auto val = foldScalarExtractFromFromElements(*this))
return val;
+ SmallVector<Value> operands = {getVector()};
+ if (succeeded(foldConstantOp(*this, operands)))
----------------
linuxlonelyeagle wrote:
This is a great learning opportunity, sure, thank you.I've finished fold extractOp and insertOp, I'll commit it first, and I'll add fold poison later (I need a little time.).
https://github.com/llvm/llvm-project/pull/124399
More information about the Mlir-commits
mailing list