From 2b45895df46e3e87b9588bd207f417d2d2fe7482 Mon Sep 17 00:00:00 2001 From: Lang Hames Date: Fri, 21 May 2021 21:48:28 -0700 Subject: [PATCH] [JITLink] Move some Block bitfields into Addressable to improve packing. Keeping these bitfields from Block to Addressable allows them to be packed with the bitfields at the end of Addressable, reducing the size of Block by eight bytes. --- llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h b/llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h index ef30775c51cf..770917f888b9 100644 --- a/llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h +++ b/llvm/include/llvm/ExecutionEngine/JITLink/JITLink.h @@ -135,6 +135,11 @@ private: JITTargetAddress Address = 0; uint64_t IsDefined : 1; uint64_t IsAbsolute : 1; + +protected: + // bitfields for Block, allocated here to improve packing. + uint64_t P2Align : 5; + uint64_t AlignmentOffset : 57; }; using SectionOrdinal = unsigned; @@ -265,8 +270,6 @@ public: private: static constexpr uint64_t MaxAlignmentOffset = (1ULL << 57) - 1; - uint64_t P2Align : 5; - uint64_t AlignmentOffset : 57; Section &Parent; const char *Data = nullptr; size_t Size = 0;