[PATCH] D22281: [CodeGen] Refactor MachineMemOperand's Flags enum.

Matthias Braun via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 12 20:31:06 PDT 2016


MatzeB added inline comments.

================
Comment at: include/llvm/CodeGen/MachineMemOperand.h:102
@@ +101,3 @@
+  /// via ENABLE_FLAGS_ENUM.
+  enum Flags {
+    // No flags set.
----------------
chandlerc wrote:
> MatzeB wrote:
> > You could change this to `enum Flags : uint16_t {...}` so that spltting the alignment won't make the MemOperands larger than before.
> > I assume the MOMaxFlag can is unnecessary as well now?
> a fixed underlying type can't *shrink* an enum... if it only requires <= 16 bits to represent the largest enumerator, that's how many bits you'll get?
Unfortunately all popular compilers out there choose unsigned/int even for smaller enums, so explicitely shrinking it is important!


http://reviews.llvm.org/D22281





More information about the llvm-commits mailing list