[llvm] 38c481d - [GVN] Fold variable into assert. NFC
Benjamin Kramer via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 9 15:40:48 PST 2023
Author: Benjamin Kramer
Date: 2023-01-10T00:39:51+01:00
New Revision: 38c481ddcbd916560890c60be1fe92d571922a23
URL: https://github.com/llvm/llvm-project/commit/38c481ddcbd916560890c60be1fe92d571922a23
DIFF: https://github.com/llvm/llvm-project/commit/38c481ddcbd916560890c60be1fe92d571922a23.diff
LOG: [GVN] Fold variable into assert. NFC
Avoids unused variable warnings when asserts are disabled.
Added:
Modified:
llvm/lib/Transforms/Scalar/GVN.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Scalar/GVN.cpp b/llvm/lib/Transforms/Scalar/GVN.cpp
index 995c73f2ece1..7e8f7368e740 100644
--- a/llvm/lib/Transforms/Scalar/GVN.cpp
+++ b/llvm/lib/Transforms/Scalar/GVN.cpp
@@ -1635,9 +1635,7 @@ bool GVNPass::PerformLoadPRE(LoadInst *Load, AvailValInBlkVect &ValuesPerBlock,
// Decide whether PRE is profitable for this load.
unsigned NumInsertPreds = PredLoads.size() + CriticalEdgePredSplit.size();
- unsigned NumUnavailablePreds = NumInsertPreds +
- CriticalEdgePredAndLoad.size();
- assert(NumUnavailablePreds != 0 &&
+ assert(NumInsertPreds + CriticalEdgePredAndLoad.size() != 0 &&
"Fully available value should already be eliminated!");
// If we need to insert new load in multiple predecessors, reject it.
More information about the llvm-commits
mailing list