diff --git a/llvm/include/llvm/IR/Intrinsics.h b/llvm/include/llvm/IR/Intrinsics.h --- a/llvm/include/llvm/IR/Intrinsics.h +++ b/llvm/include/llvm/IR/Intrinsics.h @@ -134,9 +134,7 @@ unsigned Pointer_AddressSpace; unsigned Struct_NumElements; unsigned Argument_Info; - // There is no default constructor in `ElementCount`, so we need - // to explicitly initialize this field with a value. - ElementCount Vector_Width = ElementCount::getFixed(0); + ElementCount Vector_Width; }; enum ArgKind { diff --git a/llvm/include/llvm/Support/TypeSize.h b/llvm/include/llvm/Support/TypeSize.h --- a/llvm/include/llvm/Support/TypeSize.h +++ b/llvm/include/llvm/Support/TypeSize.h @@ -35,14 +35,12 @@ ElementCount(unsigned Min, bool Scalable) : Min(Min), Scalable(Scalable) {} public: - /// No default constructor. Users should use one of the `get*` - /// static methods below, as they should always make a conscious - /// choice on the type of `ElementCount` they are requesting. - ElementCount() = delete; unsigned Min; // Minimum number of vector elements. bool Scalable; // If true, NumElements is a multiple of 'Min' determined // at runtime rather than compile time. + ElementCount() = default; + ElementCount operator*(unsigned RHS) { return { Min * RHS, Scalable }; }