[PATCH] D83119: [Alignment][NFC] Use 5 bits to store Instructions Alignment
Clement Courbet via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 3 01:35:27 PDT 2020
courbet accepted this revision.
courbet added a comment.
This revision is now accepted and ready to land.
Cool ! Only minor comments.
================
Comment at: llvm/include/llvm/IR/Instruction.h:61
+ template <unsigned Offset>
+ using BitfieldAlignmentElement =
+ typename Bitfield::Element<unsigned, Offset, 5,
----------------
[bikeshedding] Shouldn't that be `AlignmentBitfieldElement` ?
================
Comment at: llvm/include/llvm/IR/Instruction.h:59
+ // Template alias so that all Instruction storing alignment use the same
+ // definiton.
+ template <unsigned Offset>
----------------
Add comment: `// Align(1) is stored as 0. Valid alignments are powers of two from 2^0 to 2^MaxAlignmentExponent = 2^29, so we need 5 bits to encode the 30 possible values.`
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D83119/new/
https://reviews.llvm.org/D83119
More information about the llvm-commits
mailing list