[PATCH] D81662: [NFC] Use ADT/Bitfields in Instructions

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 11 14:20:26 PDT 2020


craig.topper added inline comments.


================
Comment at: llvm/include/llvm/IR/InstrTypes.h:1098
 class CallBase : public Instruction {
+  using CallingConvField = Bitfield<CallingConv::ID, 2, 10>; // Next bit:12
+
----------------
gchatelet wrote:
> Previous code was not explicit about the size of the packed bit, so it was possible to pass in values that would be truncated when stored (values `>=8192`)
> Additionally the first two bits were left unused which would force a shift operation for both get and set.
> 
> I believe we can just make the bitfield start at `0`
Isn't TailCallKind from CallInst in bits 0 and 1?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D81662





More information about the llvm-commits mailing list