[PATCH] D105423: Add support for zero-sized Scalars as a LowLevelType

Paulo Matos via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 20 03:46:12 PDT 2021


pmatos added inline comments.


================
Comment at: llvm/include/llvm/Support/LowLevelTypeImpl.h:334
   uint64_t IsVector : 1;
-  uint64_t RawData : 62;
+  uint64_t RawData : 61;
 
----------------
pmatos wrote:
> arsenm wrote:
> > Leftover change?
> No, the RawData uses 1 less bit, so 61 instead of 62 because we are taking a bit to encode if a value is a scalar. We need this explicit bit because before a scalar was something with `!IsPointer && !IsVector`. However, by allowing `RawData` to be zero in scalar, we need a bit for scalars to verify that a value is a scalar and allow its rawdata to be zero.
I am starting to think we could actually get away without a IsScalar, and allow a `!IsPointer && !IsVector` of zero size. There's a reason I added an `IsScalar` but I forget exactly why. I will do some further investigation.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D105423/new/

https://reviews.llvm.org/D105423



More information about the llvm-commits mailing list