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

llvmlistbot at llvm.org llvmlistbot at llvm.org
Tue May 13 15:53:57 PDT 2025


Author: Kazu Hirata
Date: 2025-05-13T15:53:54-07:00
New Revision: 50316c1eb8ed189dc3a979d552b8b04b0730b287

URL: https://github.com/llvm/llvm-project/commit/50316c1eb8ed189dc3a979d552b8b04b0730b287
DIFF: https://github.com/llvm/llvm-project/commit/50316c1eb8ed189dc3a979d552b8b04b0730b287.diff

LOG: [mlir] Use llvm::binary_search (NFC) (#139760)

Added: 
    

Modified: 
    mlir/lib/Dialect/Tensor/IR/TensorOps.cpp

Removed: 
    


################################################################################
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