[PATCH] D18106: Extract out a SelectionDAGBuilder::LowerAsStatepoint; NFC

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 16 15:47:20 PDT 2016


reames accepted this revision.
reames added a comment.
This revision is now accepted and ready to land.

LGTM.  I'm happy to see this evolve further in tree.  Having the other user will also make it far more obvious where we've gotten the API wrong.  :)

minor comments below.  Can be done either before submission or as separate changes depending on your preference.


================
Comment at: lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h:752
@@ +751,3 @@
+    /// The ID that the resulting STATEPOINT instruction has to report.
+    unsigned ID = -1;
+
----------------
Why explicitly initial this and none of the other fields?

================
Comment at: lib/CodeGen/SelectionDAG/StatepointLowering.cpp:437
@@ -505,12 +436,3 @@
 /// will be set to the last value spilled (if any were).
-static void lowerStatepointMetaArgs(SmallVectorImpl<SDValue> &Ops,
-                                    ImmutableStatepoint StatepointSite,
-                                    SelectionDAGBuilder &Builder) {
-
-  // Lower the deopt and gc arguments for this statepoint.  Layout will
-  // be: deopt argument length, deopt arguments.., gc arguments...
-
-  SmallVector<const Value *, 64> Bases, Ptrs;
-  SmallVector<const GCRelocateInst *, 64> Relocations;
-  getIncomingStatepointGCValues(Bases, Ptrs, Relocations, StatepointSite,
-                                Builder);
+static void lowerStatepointLoweringInfoMetaArgs(
+    SmallVectorImpl<SDValue> &Ops,
----------------
minor: I wouldn't bother changing the function name in this way.

================
Comment at: lib/CodeGen/SelectionDAG/StatepointLowering.cpp:511
@@ -591,3 +510,3 @@
   // the alloca
-  for (Value *V : StatepointSite.gc_args()) {
+  for (Value *V : SI.GCArgs) {
     SDValue Incoming = Builder.getValue(V);
----------------
This comment still applies.  A follow on commit is fine.

================
Comment at: lib/CodeGen/SelectionDAG/StatepointLowering.cpp:795
@@ +794,3 @@
+
+#ifndef NDEBUG
+  // If this is a malformed statepoint, report it early to simplify debugging.
----------------
Might be good to lift these two to the top of the function.


http://reviews.llvm.org/D18106





More information about the llvm-commits mailing list