[PATCH] D22249: Get rid of bool parameters in SelectionDAG::getLoad, getStore, and friends.

Chandler Carruth via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 11 18:15:17 PDT 2016


chandlerc added inline comments.

================
Comment at: include/llvm/CodeGen/SelectionDAG.h:915-920
@@ -914,6 +914,8 @@
   ///
+  /// MMOFlags must be a combination of values from
+  /// MachineMemOperand::MemOperandFlags.  MOLoad is implicitly set (but you can
+  /// set it if you want).  MOStore must not be set.
   SDValue getLoad(EVT VT, const SDLoc &dl, SDValue Chain, SDValue Ptr,
-                  MachinePointerInfo PtrInfo, bool isVolatile,
-                  bool isNonTemporal, bool isInvariant, unsigned Alignment,
-                  const AAMDNodes &AAInfo = AAMDNodes(),
+                  MachinePointerInfo PtrInfo, unsigned Alignment = 0,
+                  unsigned MMOFlags = 0, const AAMDNodes &AAInfo = AAMDNodes(),
                   const MDNode *Ranges = nullptr);
----------------
jlebar wrote:
> chandlerc wrote:
> > Can you make this an actual enum type instead of unsigned?
> That would be really nice, but I don't know of a way to do it safely.  It's UB to use (create?) an enum value that's not one of the enumerated values, right?  So static_cast<MyEnum>(MyEnum::Foo | MyEnum::Bar) is sadface.
To relay the IRC conversation -- this is actually OK because the enumerator has enough bits.


http://reviews.llvm.org/D22249





More information about the llvm-commits mailing list