[llvm] 1c34257 - [LV] Use value_or to simplify code. NFC (#77030)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 10 12:40:31 PST 2024
Author: Craig Topper
Date: 2024-01-10T12:40:26-08:00
New Revision: 1c342571b80d0f76202ec590a19706fe9e05c86d
URL: https://github.com/llvm/llvm-project/commit/1c342571b80d0f76202ec590a19706fe9e05c86d
DIFF: https://github.com/llvm/llvm-project/commit/1c342571b80d0f76202ec590a19706fe9e05c86d.diff
LOG: [LV] Use value_or to simplify code. NFC (#77030)
Added:
Modified:
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
index 1a5b9dbb82fa04..9743fa0e740200 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -5004,9 +5004,8 @@ VectorizationFactor LoopVectorizationPlanner::selectVectorizationFactor(
VectorizationFactor Candidate(i, C.first, ScalarCost.ScalarCost);
#ifndef NDEBUG
- unsigned AssumedMinimumVscale = 1;
- if (std::optional<unsigned> VScale = getVScaleForTuning(OrigLoop, TTI))
- AssumedMinimumVscale = *VScale;
+ unsigned AssumedMinimumVscale =
+ getVScaleForTuning(OrigLoop, TTI).value_or(1);
unsigned Width =
Candidate.Width.isScalable()
? Candidate.Width.getKnownMinValue() * AssumedMinimumVscale
More information about the llvm-commits
mailing list