[PATCH] D86240: [llvm] Add default constructor of `llvm::ElementCount`.
Francesco Petrogalli via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 19 14:40:41 PDT 2020
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGdac0b1d33088: [llvm] Add default constructor of `llvm::ElementCount`. (authored by fpetrogalli).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D86240/new/
https://reviews.llvm.org/D86240
Files:
llvm/include/llvm/IR/Intrinsics.h
llvm/include/llvm/Support/TypeSize.h
Index: llvm/include/llvm/Support/TypeSize.h
===================================================================
--- llvm/include/llvm/Support/TypeSize.h
+++ 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 };
}
Index: llvm/include/llvm/IR/Intrinsics.h
===================================================================
--- llvm/include/llvm/IR/Intrinsics.h
+++ 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 {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D86240.286668.patch
Type: text/x-patch
Size: 1406 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200819/48b5794f/attachment.bin>
More information about the llvm-commits
mailing list