[Mlir-commits] [mlir] [mlir][spirv] Add common SPIRV Extended Ops for Vectors (PR #122322)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Thu Jan 9 09:49:11 PST 2025
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff dfa5ee2af27da2eee835560bd1f1c872991a558d 52d61dd0be09b211cd4b2feb40f89a7f6ff82272 --extensions cpp -- mlir/lib/Dialect/SPIRV/IR/SPIRVOps.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/mlir/lib/Dialect/SPIRV/IR/SPIRVOps.cpp b/mlir/lib/Dialect/SPIRV/IR/SPIRVOps.cpp
index b789ead75f..5305fb88e2 100644
--- a/mlir/lib/Dialect/SPIRV/IR/SPIRVOps.cpp
+++ b/mlir/lib/Dialect/SPIRV/IR/SPIRVOps.cpp
@@ -2115,17 +2115,19 @@ LogicalResult spirv::GLDistanceOp::verify() {
FloatType resultFloatType = llvm::dyn_cast<FloatType>(resultType);
if (!p0FloatType || !p1FloatType || !resultFloatType)
- return emitOpError("operands and result must be float scalar or vector of float");
+ return emitOpError(
+ "operands and result must be float scalar or vector of float");
if (p0FloatType != resultFloatType || p1FloatType != resultFloatType)
return emitOpError("operand and result element types must match");
if (auto p0Vec = llvm::dyn_cast<VectorType>(p0Type)) {
- if (!llvm::dyn_cast<VectorType>(p1Type) ||
+ if (!llvm::dyn_cast<VectorType>(p1Type) ||
p0Vec.getShape() != llvm::dyn_cast<VectorType>(p1Type).getShape())
return emitOpError("vector operands must have same shape");
} else if (llvm::isa<VectorType>(p1Type)) {
- return emitOpError("expected both operands to be scalars or both to be vectors");
+ return emitOpError(
+ "expected both operands to be scalars or both to be vectors");
}
return success();
``````````
</details>
https://github.com/llvm/llvm-project/pull/122322
More information about the Mlir-commits
mailing list