[Mlir-commits] [mlir] 5f0f269 - [MemRef] Fix -Wunused-function (#194366)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Mon Apr 27 06:24:49 PDT 2026
Author: Aiden Grossman
Date: 2026-04-27T06:24:44-07:00
New Revision: 5f0f269d5f835a07d74a2428e7e372c60b4c048f
URL: https://github.com/llvm/llvm-project/commit/5f0f269d5f835a07d74a2428e7e372c60b4c048f
DIFF: https://github.com/llvm/llvm-project/commit/5f0f269d5f835a07d74a2428e7e372c60b4c048f.diff
LOG: [MemRef] Fix -Wunused-function (#194366)
areIndicesInBounds is only used within an assert statement, so mark it
[[maybe_unused]] so that the compiler does not otherwise warn in
non-assertion builds.
Added:
Modified:
mlir/lib/Dialect/MemRef/Transforms/ElideReinterpretCast.cpp
Removed:
################################################################################
diff --git a/mlir/lib/Dialect/MemRef/Transforms/ElideReinterpretCast.cpp b/mlir/lib/Dialect/MemRef/Transforms/ElideReinterpretCast.cpp
index 16b230c9d3896..41dad1384da75 100644
--- a/mlir/lib/Dialect/MemRef/Transforms/ElideReinterpretCast.cpp
+++ b/mlir/lib/Dialect/MemRef/Transforms/ElideReinterpretCast.cpp
@@ -323,7 +323,7 @@ static bool isPureRankExpansionOrCollapsingRC(memref::ReinterpretCastOp rc) {
/// Checks statically known and constant indices accessed by a load from a pure
/// rank expansion/collapsing to ensure in-bounds only access. Fully dynamic
/// indices are skipped (there is no way to verify them).
-static bool areIndicesInBounds(memref::LoadOp load) {
+[[maybe_unused]] static bool areIndicesInBounds(memref::LoadOp load) {
auto rc = load.getMemRef().getDefiningOp<memref::ReinterpretCastOp>();
auto rcOutputTy = cast<MemRefType>(rc.getResult().getType());
More information about the Mlir-commits
mailing list