[PATCH] D159259: [mlir][vector] Use optional for outerproduct accumulator instead of variadic
Cullen Rhodes via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 31 23:04:04 PDT 2023
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG067bd7d0512b: [mlir][vector] Use optional for outerproduct accumulator instead of variadic (authored by c-rhodes).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D159259/new/
https://reviews.llvm.org/D159259
Files:
mlir/include/mlir/Dialect/Vector/IR/VectorOps.td
mlir/lib/Dialect/Vector/IR/VectorOps.cpp
mlir/lib/Dialect/Vector/Transforms/LowerVectorContract.cpp
Index: mlir/lib/Dialect/Vector/Transforms/LowerVectorContract.cpp
===================================================================
--- mlir/lib/Dialect/Vector/Transforms/LowerVectorContract.cpp
+++ mlir/lib/Dialect/Vector/Transforms/LowerVectorContract.cpp
@@ -1128,7 +1128,7 @@
VectorType resType = op.getResultVectorType();
Type eltType = resType.getElementType();
bool isInt = isa<IntegerType, IndexType>(eltType);
- Value acc = (op.getAcc().empty()) ? nullptr : op.getAcc()[0];
+ Value acc = op.getAcc();
vector::CombiningKind kind = op.getKind();
// Vector mask setup.
Index: mlir/lib/Dialect/Vector/IR/VectorOps.cpp
===================================================================
--- mlir/lib/Dialect/Vector/IR/VectorOps.cpp
+++ mlir/lib/Dialect/Vector/IR/VectorOps.cpp
@@ -2756,7 +2756,7 @@
void OuterProductOp::print(OpAsmPrinter &p) {
p << " " << getLhs() << ", " << getRhs();
- if (!getAcc().empty()) {
+ if (getAcc()) {
p << ", " << getAcc();
p.printOptionalAttrDict((*this)->getAttrs());
}
Index: mlir/include/mlir/Dialect/Vector/IR/VectorOps.td
===================================================================
--- mlir/include/mlir/Dialect/Vector/IR/VectorOps.td
+++ mlir/include/mlir/Dialect/Vector/IR/VectorOps.td
@@ -897,7 +897,7 @@
TCresVTEtIsSameAsOpBase<0, 1>>,
DeclareOpInterfaceMethods<MaskableOpInterface>]>,
Arguments<(ins AnyVector:$lhs, AnyType:$rhs,
- Variadic<AnyVector>:$acc,
+ Optional<AnyVector>:$acc,
DefaultValuedAttr<Vector_CombiningKindAttr, "CombiningKind::ADD">:$kind)>,
Results<(outs AnyVector)> {
let summary = "vector outerproduct with optional fused add";
@@ -961,9 +961,9 @@
return getRhs().getType();
}
VectorType getOperandVectorTypeACC() {
- return getAcc().empty()
- ? VectorType()
- : ::llvm::cast<VectorType>((*getAcc().begin()).getType());
+ return getAcc()
+ ? ::llvm::cast<VectorType>(getAcc().getType())
+ : VectorType();
}
VectorType getResultVectorType() {
return ::llvm::cast<VectorType>(getResult().getType());
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D159259.555267.patch
Type: text/x-patch
Size: 2181 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230901/5f73aecd/attachment.bin>
More information about the llvm-commits
mailing list