[Mlir-commits] [mlir] [mlir] To fix a compile time warning. (PR #131151)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Thu Mar 13 08:01:58 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-mlir-affine

Author: Daniel Chen (DanielCChen)

<details>
<summary>Changes</summary>

Our build on AIX issues warning on unused varaible
```
llvm-project/mlir/lib/Dialect/Affine/Utils/LoopUtils.cpp:2065:14: warning: variable 'caf' set but not used [-Wunused-but-set-variable]
 2065 |     if (auto caf = lbs[d].isSingleConstant()) {
      |              ^
1 warning generated.
```

---
Full diff: https://github.com/llvm/llvm-project/pull/131151.diff


1 Files Affected:

- (modified) mlir/lib/Dialect/Affine/Utils/LoopUtils.cpp (+1-1) 


``````````diff
diff --git a/mlir/lib/Dialect/Affine/Utils/LoopUtils.cpp b/mlir/lib/Dialect/Affine/Utils/LoopUtils.cpp
index b58bf3f271d47..71c6acba32d2e 100644
--- a/mlir/lib/Dialect/Affine/Utils/LoopUtils.cpp
+++ b/mlir/lib/Dialect/Affine/Utils/LoopUtils.cpp
@@ -2062,7 +2062,7 @@ static LogicalResult generateCopy(
 
     // Set copy start location for this dimension in the lower memory space
     // memref.
-    if (auto caf = lbs[d].isSingleConstant()) {
+    if (lbs[d].isSingleConstant()) {
       auto indexVal = lbs[d].getSingleConstantResult();
       if (indexVal == 0) {
         memIndices.push_back(zeroIndex);

``````````

</details>


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


More information about the Mlir-commits mailing list