[llvm] 9d09c77 - [VPlan] Make VPBlockTy enum protected (NFC) (#209863)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 15 12:49:06 PDT 2026
Author: Florian Hahn
Date: 2026-07-15T19:49:00Z
New Revision: 9d09c774832bc99cde76ecb4847bb01680da533d
URL: https://github.com/llvm/llvm-project/commit/9d09c774832bc99cde76ecb4847bb01680da533d
DIFF: https://github.com/llvm/llvm-project/commit/9d09c774832bc99cde76ecb4847bb01680da533d.diff
LOG: [VPlan] Make VPBlockTy enum protected (NFC) (#209863)
VPBlockTy is an implementation detail, that is only needed in sub-types.
Make protected.
Added:
Modified:
llvm/lib/Transforms/Vectorize/VPlan.h
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Vectorize/VPlan.h b/llvm/lib/Transforms/Vectorize/VPlan.h
index 15c1e2d2db0ba..b67d1a1281c14 100644
--- a/llvm/lib/Transforms/Vectorize/VPlan.h
+++ b/llvm/lib/Transforms/Vectorize/VPlan.h
@@ -94,6 +94,18 @@ enum class UncountableExitStyle {
class LLVM_ABI_FOR_TEST VPBlockBase {
friend class VPBlockUtils;
+protected:
+ /// An enumeration for keeping track of the concrete subclass of VPBlockBase
+ /// that are actually instantiated. Values of this enumeration are kept in the
+ /// SubclassID field of the VPBlockBase objects. They are used for concrete
+ /// type identification.
+ using VPBlockTy = enum : unsigned char {
+ VPRegionBlockSC,
+ VPBasicBlockSC,
+ VPIRBasicBlockSC
+ };
+
+private:
/// An optional name for the block.
std::string Name;
@@ -111,6 +123,9 @@ class LLVM_ABI_FOR_TEST VPBlockBase {
/// plan.
VPlan *Plan = nullptr;
+ /// Subclass identifier (for isa/dyn_cast).
+ const VPBlockTy SubclassID;
+
/// Add \p Successor as the last successor to this block.
void appendSuccessor(VPBlockBase *Successor) {
assert(Successor && "Cannot add nullptr successor!");
@@ -158,16 +173,6 @@ class LLVM_ABI_FOR_TEST VPBlockBase {
}
public:
- /// An enumeration for keeping track of the concrete subclass of VPBlockBase
- /// that are actually instantiated. Values of this enumeration are kept in the
- /// SubclassID field of the VPBlockBase objects. They are used for concrete
- /// type identification.
- using VPBlockTy = enum : unsigned char {
- VPRegionBlockSC,
- VPBasicBlockSC,
- VPIRBasicBlockSC
- };
-
using VPBlocksTy = SmallVectorImpl<VPBlockBase *>;
virtual ~VPBlockBase() = default;
@@ -382,9 +387,6 @@ class LLVM_ABI_FOR_TEST VPBlockBase {
/// region for VPRegionBlocks.
virtual VPBlockBase *clone() = 0;
-private:
- const VPBlockTy SubclassID; ///< Subclass identifier (for isa/dyn_cast).
-
protected:
VPBlockBase(VPBlockTy SC, const std::string &N) : Name(N), SubclassID(SC) {}
};
More information about the llvm-commits
mailing list