Skip to content

Commit c95af08

Browse files
committed
[VPlan] Move ::getVectorLoopRegion out of ifdef (NFC).
Fixes a build failure with assertions disabled after 6c8f41d.
1 parent bdd3658 commit c95af08

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

llvm/lib/Transforms/Vectorize/VPlan.cpp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1090,6 +1090,21 @@ InstructionCost VPlan::cost(ElementCount VF, VPCostContext &Ctx) {
10901090
return getVectorLoopRegion()->cost(VF, Ctx);
10911091
}
10921092

1093+
VPRegionBlock *VPlan::getVectorLoopRegion() {
1094+
// TODO: Cache if possible.
1095+
for (VPBlockBase *B : vp_depth_first_shallow(getEntry()))
1096+
if (auto *R = dyn_cast<VPRegionBlock>(B))
1097+
return R;
1098+
return nullptr;
1099+
}
1100+
1101+
const VPRegionBlock *VPlan::getVectorLoopRegion() const {
1102+
for (const VPBlockBase *B : vp_depth_first_shallow(getEntry()))
1103+
if (auto *R = dyn_cast<VPRegionBlock>(B))
1104+
return R;
1105+
return nullptr;
1106+
}
1107+
10931108
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
10941109
void VPlan::printLiveIns(raw_ostream &O) const {
10951110
VPSlotTracker SlotTracker(this);
@@ -1167,21 +1182,6 @@ std::string VPlan::getName() const {
11671182
return Out;
11681183
}
11691184

1170-
VPRegionBlock *VPlan::getVectorLoopRegion() {
1171-
// TODO: Cache if possible.
1172-
for (VPBlockBase *B : vp_depth_first_shallow(getEntry()))
1173-
if (auto *R = dyn_cast<VPRegionBlock>(B))
1174-
return R;
1175-
return nullptr;
1176-
}
1177-
1178-
const VPRegionBlock *VPlan::getVectorLoopRegion() const {
1179-
for (const VPBlockBase *B : vp_depth_first_shallow(getEntry()))
1180-
if (auto *R = dyn_cast<VPRegionBlock>(B))
1181-
return R;
1182-
return nullptr;
1183-
}
1184-
11851185
LLVM_DUMP_METHOD
11861186
void VPlan::printDOT(raw_ostream &O) const {
11871187
VPlanPrinter Printer(O, *this);

0 commit comments

Comments
 (0)