[PATCH] D50680: [SDAG] Remove the reliance on MI's allocation strategy for `MachineMemOperand` pointers attached to `MachineSDNodes` and instead have the `SelectionDAG` fully manage the memory for this array.

Chandler Carruth via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 13 19:27:59 PDT 2018


chandlerc added a comment.

I think all done.



================
Comment at: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:2270
-  /// list. This does not transfer ownership.
-  void setMemRefs(mmo_iterator NewMemRefs, mmo_iterator NewMemRefsEnd) {
-    for (mmo_iterator MMI = NewMemRefs, MME = NewMemRefsEnd; MMI != MME; ++MMI)
----------------
bogner wrote:
> Should the doxygen of MachineSDNode mention SelectionDAG::setNodeMemRefs somewhere?
Added comments explaining this.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:7112
+  N->MemRefs = MemRefsBuffer;
+  N->NumMemRefs = (int)NewMemRefs.size();
+}
----------------
bogner wrote:
> C++ style casts are arguably a bit clearer (but feel free to ignore this if you disagree)
For primitive types, it never seems worth it to me, but I don't feel strongly here. Changed.


Repository:
  rL LLVM

https://reviews.llvm.org/D50680





More information about the llvm-commits mailing list