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

Justin Lebar via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 13 09:01:55 PDT 2016


jlebar added inline comments.

================
Comment at: include/llvm/CodeGen/MachineMemOperand.h:102
@@ +101,3 @@
+  /// via ENABLE_FLAGS_ENUM.
+  enum Flags {
+    // No flags set.
----------------
MatzeB wrote:
> 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!
Yes, of course -- this got lost while I was bisecting a bug in my changes.  Sorry about that.


http://reviews.llvm.org/D22281





More information about the llvm-commits mailing list