[Mlir-commits] [mlir] [mlir] Use llvm::binary_search (NFC) (PR #139760)

Kazu Hirata llvmlistbot at llvm.org
Tue May 13 09:09:23 PDT 2025


https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/139760

None

>From 50ea7f33e27b8eb8097a16d13626d8dd2c3a9ad5 Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Tue, 13 May 2025 09:05:26 -0700
Subject: [PATCH] [mlir] Use llvm::binary_search (NFC)

---
 mlir/lib/Dialect/Tensor/IR/TensorOps.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mlir/lib/Dialect/Tensor/IR/TensorOps.cpp b/mlir/lib/Dialect/Tensor/IR/TensorOps.cpp
index 29da32cd1791c..815806f06b472 100644
--- a/mlir/lib/Dialect/Tensor/IR/TensorOps.cpp
+++ b/mlir/lib/Dialect/Tensor/IR/TensorOps.cpp
@@ -1356,7 +1356,7 @@ RankedTensorType GatherOp::inferResultType(RankedTensorType sourceType,
   SmallVector<int64_t> resultShape(indicesType.getShape().drop_back());
   resultShape.reserve(resultShape.size() + sourceType.getRank());
   for (int64_t idx : llvm::seq<int64_t>(0, sourceType.getRank())) {
-    if (std::binary_search(gatherDims.begin(), gatherDims.end(), idx)) {
+    if (llvm::binary_search(gatherDims, idx)) {
       if (!rankReduced)
         resultShape.push_back(1);
       continue;



More information about the Mlir-commits mailing list