[llvm] [CodeGen] Simplify LLT bitfields. NFC. (PR #120074)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 16 04:58:35 PST 2024


================
@@ -352,44 +339,23 @@ class LLT {
   ///   valid encodings, SizeInBits/SizeOfElement must be larger than 0.
   /// * Non-pointer scalar (isPointer == 0 && isVector == 0):
   ///   SizeInBits: 32;
-  static const constexpr BitFieldInfo ScalarSizeFieldInfo{32, 0};
+  static const constexpr BitFieldInfo ScalarSizeFieldInfo{32, 29};
----------------
jayfoad wrote:

The offsets are chosen to put most fields on nice-ish byte/word boundaries _on little-endian hosts_. I think that's the best we can do given that the fields in LLT are a mixture of real bitfields, and fields manually packed into the 61-bit RawData bitfield.

I think it would be better to manually pack all fields into a 64-bit RawData value, but that would be an orthogonal improvement.

https://github.com/llvm/llvm-project/pull/120074


More information about the llvm-commits mailing list