[llvm] c95af08 - [VPlan] Move ::getVectorLoopRegion out of ifdef (NFC).
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 12 08:22:04 PST 2024
Author: Florian Hahn
Date: 2024-12-12T16:21:21Z
New Revision: c95af0844d64f15b99fab37c25efb01a8d783847
URL: https://github.com/llvm/llvm-project/commit/c95af0844d64f15b99fab37c25efb01a8d783847
DIFF: https://github.com/llvm/llvm-project/commit/c95af0844d64f15b99fab37c25efb01a8d783847.diff
LOG: [VPlan] Move ::getVectorLoopRegion out of ifdef (NFC).
Fixes a build failure with assertions disabled after
6c8f41d336747.
Added:
Modified:
llvm/lib/Transforms/Vectorize/VPlan.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Vectorize/VPlan.cpp b/llvm/lib/Transforms/Vectorize/VPlan.cpp
index 0ede3012e16593..d3476399dabf15 100644
--- a/llvm/lib/Transforms/Vectorize/VPlan.cpp
+++ b/llvm/lib/Transforms/Vectorize/VPlan.cpp
@@ -1090,6 +1090,21 @@ InstructionCost VPlan::cost(ElementCount VF, VPCostContext &Ctx) {
return getVectorLoopRegion()->cost(VF, Ctx);
}
+VPRegionBlock *VPlan::getVectorLoopRegion() {
+ // TODO: Cache if possible.
+ for (VPBlockBase *B : vp_depth_first_shallow(getEntry()))
+ if (auto *R = dyn_cast<VPRegionBlock>(B))
+ return R;
+ return nullptr;
+}
+
+const VPRegionBlock *VPlan::getVectorLoopRegion() const {
+ for (const VPBlockBase *B : vp_depth_first_shallow(getEntry()))
+ if (auto *R = dyn_cast<VPRegionBlock>(B))
+ return R;
+ return nullptr;
+}
+
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
void VPlan::printLiveIns(raw_ostream &O) const {
VPSlotTracker SlotTracker(this);
@@ -1167,21 +1182,6 @@ std::string VPlan::getName() const {
return Out;
}
-VPRegionBlock *VPlan::getVectorLoopRegion() {
- // TODO: Cache if possible.
- for (VPBlockBase *B : vp_depth_first_shallow(getEntry()))
- if (auto *R = dyn_cast<VPRegionBlock>(B))
- return R;
- return nullptr;
-}
-
-const VPRegionBlock *VPlan::getVectorLoopRegion() const {
- for (const VPBlockBase *B : vp_depth_first_shallow(getEntry()))
- if (auto *R = dyn_cast<VPRegionBlock>(B))
- return R;
- return nullptr;
-}
-
LLVM_DUMP_METHOD
void VPlan::printDOT(raw_ostream &O) const {
VPlanPrinter Printer(O, *this);
More information about the llvm-commits
mailing list