[Mlir-commits] [mlir] [MLIR] NFC. Remove anti-patterns given the default null init for Value (PR #99457)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Thu Jul 18 02:10:04 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-mlir-affine
@llvm/pr-subscribers-mlir
Author: Uday Bondhugula (bondhugula)
<details>
<summary>Changes</summary>
Remove anti-patterns given the default null init for Value. Drop some
extra includes while on this file. NFC.
---
Full diff: https://github.com/llvm/llvm-project/pull/99457.diff
1 Files Affected:
- (modified) mlir/lib/Dialect/Affine/Utils/LoopUtils.cpp (+2-4)
``````````diff
diff --git a/mlir/lib/Dialect/Affine/Utils/LoopUtils.cpp b/mlir/lib/Dialect/Affine/Utils/LoopUtils.cpp
index 605737542e9fc..f09d93f3ba444 100644
--- a/mlir/lib/Dialect/Affine/Utils/LoopUtils.cpp
+++ b/mlir/lib/Dialect/Affine/Utils/LoopUtils.cpp
@@ -12,10 +12,8 @@
#include "mlir/Dialect/Affine/LoopUtils.h"
#include "mlir/Analysis/SliceAnalysis.h"
-#include "mlir/Dialect/Affine/Analysis/AffineAnalysis.h"
#include "mlir/Dialect/Affine/Analysis/LoopAnalysis.h"
#include "mlir/Dialect/Affine/Analysis/Utils.h"
-#include "mlir/Dialect/Affine/IR/AffineOps.h"
#include "mlir/Dialect/Affine/IR/AffineValueMap.h"
#include "mlir/Dialect/Affine/Utils.h"
#include "mlir/Dialect/Func/IR/FuncOps.h"
@@ -2082,8 +2080,8 @@ static LogicalResult generateCopy(
auto numElementsSSA = top.create<arith::ConstantIndexOp>(loc, *numElements);
- Value dmaStride = nullptr;
- Value numEltPerDmaStride = nullptr;
+ Value dmaStride;
+ Value numEltPerDmaStride;
if (copyOptions.generateDma) {
SmallVector<StrideInfo, 4> dmaStrideInfos;
getMultiLevelStrides(region, fastBufferShape, &dmaStrideInfos);
``````````
</details>
https://github.com/llvm/llvm-project/pull/99457
More information about the Mlir-commits
mailing list