[Mlir-commits] [mlir] [mlir] Remove a redundant cast (NFC) (PR #168241)

Kazu Hirata llvmlistbot at llvm.org
Sat Nov 15 13:29:09 PST 2025


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

llvm::all_of already returns bool.

Identified with readability-redundant-casting.


>From 0081ba39d597622519d614399716027faa8afba0 Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Sat, 15 Nov 2025 09:57:56 -0800
Subject: [PATCH] [mlir] Remove a redundant cast (NFC)

llvm::all_of already returns bool.

Identified with readability-redundant-casting.
---
 mlir/lib/Dialect/Bufferization/Transforms/OneShotAnalysis.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mlir/lib/Dialect/Bufferization/Transforms/OneShotAnalysis.cpp b/mlir/lib/Dialect/Bufferization/Transforms/OneShotAnalysis.cpp
index 9ccbfd363b1df..5dfe3e632b340 100644
--- a/mlir/lib/Dialect/Bufferization/Transforms/OneShotAnalysis.cpp
+++ b/mlir/lib/Dialect/Bufferization/Transforms/OneShotAnalysis.cpp
@@ -497,7 +497,7 @@ static bool matchesInsertDestination(const AnalysisState &state,
   // terminates. All of them must be equivalent subsets.
   SetVector<Value> backwardSlice =
       state.findValueInReverseUseDefChain(opOperand, matchingSubset);
-  return static_cast<bool>(llvm::all_of(backwardSlice, matchingSubset));
+  return llvm::all_of(backwardSlice, matchingSubset);
 }
 
 /// Return "true" if the given "read" and potentially conflicting "write" are



More information about the Mlir-commits mailing list