[llvm] 4731623 - [LoopUnroll] Fold variable only used in assert into the assert
Benjamin Kramer via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 27 04:20:00 PDT 2023
Author: Benjamin Kramer
Date: 2023-09-27T13:19:18+02:00
New Revision: 4731623f81c47d9e879d845dee0609b84daa9efd
URL: https://github.com/llvm/llvm-project/commit/4731623f81c47d9e879d845dee0609b84daa9efd
DIFF: https://github.com/llvm/llvm-project/commit/4731623f81c47d9e879d845dee0609b84daa9efd.diff
LOG: [LoopUnroll] Fold variable only used in assert into the assert
Avoids warnings in Release builds. NFCI.
Added:
Modified:
llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
llvm/lib/Transforms/Scalar/LoopUnrollAndJamPass.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp b/llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
index 4eb91d8926d46a2..9c70d384e55db2b 100644
--- a/llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
+++ b/llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
@@ -3528,8 +3528,8 @@ static int32_t computeHeuristicUnrollFactor(CanonicalLoopInfo *CLI) {
return 1;
}
- unsigned LoopSize = UCE.getRolledLoopSize();
- LLVM_DEBUG(dbgs() << "Estimated loop size is " << LoopSize << "\n");
+ LLVM_DEBUG(dbgs() << "Estimated loop size is " << UCE.getRolledLoopSize()
+ << "\n");
// TODO: Determine trip count of \p CLI if constant, computeUnrollCount might
// be able to use it.
diff --git a/llvm/lib/Transforms/Scalar/LoopUnrollAndJamPass.cpp b/llvm/lib/Transforms/Scalar/LoopUnrollAndJamPass.cpp
index 79599726bc1eec3..67335a2d01575b1 100644
--- a/llvm/lib/Transforms/Scalar/LoopUnrollAndJamPass.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopUnrollAndJamPass.cpp
@@ -333,8 +333,8 @@ tryToUnrollAndJamLoop(Loop *L, DominatorTree &DT, LoopInfo *LI,
}
unsigned InnerLoopSize = InnerUCE.getRolledLoopSize();
- unsigned OuterLoopSize = OuterUCE.getRolledLoopSize();
- LLVM_DEBUG(dbgs() << " Outer Loop Size: " << OuterLoopSize << "\n");
+ LLVM_DEBUG(dbgs() << " Outer Loop Size: " << OuterUCE.getRolledLoopSize()
+ << "\n");
LLVM_DEBUG(dbgs() << " Inner Loop Size: " << InnerLoopSize << "\n");
if (InnerUCE.NumInlineCandidates != 0 || OuterUCE.NumInlineCandidates != 0) {
More information about the llvm-commits
mailing list