[Mlir-commits] [mlir] [mlir] Handle simple commutative cases in CSE. (PR #75274)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Tue Dec 12 18:41:38 PST 2023


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 6e761f3a04e59dd8aa1a0d3c29d81a85f5351472 d3cefdd3d0adbd4e307cb4b71c98b81fe49ce08b -- mlir/include/mlir/IR/OperationSupport.h mlir/lib/IR/OperationSupport.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/mlir/lib/IR/OperationSupport.cpp b/mlir/lib/IR/OperationSupport.cpp
index 630a3bc501..14e21dc1d1 100644
--- a/mlir/lib/IR/OperationSupport.cpp
+++ b/mlir/lib/IR/OperationSupport.cpp
@@ -683,7 +683,8 @@ llvm::hash_code OperationEquivalence::computeHash(
     hash = llvm::hash_combine(hash, op->getLoc());
 
   //   - Operands
-  if (op->hasTrait<mlir::OpTrait::IsCommutative>() && op->getNumOperands() > 0) {
+  if (op->hasTrait<mlir::OpTrait::IsCommutative>() &&
+      op->getNumOperands() > 0) {
     // If commutative, don't hash the operands as hash is not order independent
     // and even if it were would not be sufficient for CSE usage.
     // FIXME: This has the effect of resulting in more hash collisions

``````````

</details>


https://github.com/llvm/llvm-project/pull/75274


More information about the Mlir-commits mailing list