[PATCH] D71027: Support repeated machine outlining

Jessica Paquette via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 16 12:01:28 PDT 2020


paquette added a comment.

Thanks for updating this!

I have a couple nits, but I think this is pretty close to being ready. :)



================
Comment at: llvm/lib/CodeGen/MachineOutliner.cpp:1513
+    report_fatal_error("Expect NumRepeat for machine outlining "
+                       "is equal or greater than 1!\n");
+
----------------
Grammar nit: "Expect NumRepeat for machine outlining to be greater than or equal to 1"


================
Comment at: llvm/lib/CodeGen/MachineOutliner.cpp:1517
+  unsigned I;
+  for (I = 0; I < NumRepeat; I++) {
+    if (!runOnceOnModule(M, I)) {
----------------
Nit: pull `I` into the loop:

```
for (unsigned I = 0; I < NumRepeat; I++) {
 // ...
}
```


================
Comment at: llvm/lib/CodeGen/MachineOutliner.cpp:1519-1520
+    if (!runOnceOnModule(M, I)) {
+      LLVM_DEBUG(dbgs() << "Stopped outlining at iteration " << I
+                        << " because no changes were found.\n";);
+      return Changed;
----------------
Can we have a small testcase showing that this happens?


================
Comment at: llvm/lib/CodeGen/MachineOutliner.cpp:1525-1526
+  }
+  LLVM_DEBUG(dbgs() << "Stopped outlining because iteration " << I
+                    << " >= " << NumRepeat << "\n";);
+  return Changed;
----------------
Can we have a small testcase showing that this happens?


================
Comment at: llvm/test/CodeGen/AArch64/machine-outliner-iterative.mir:139-140
+# TWO-RUNS-NEXT: TCRETURNdi @OUTLINED_FUNCTION_0, 0, implicit $sp
+# FOUR-RUNS-NOT: [[OUTLINED:OUTLINED_FUNCTION_3_[0-9]+]]
+# FOUR-RUNS-NOT: [[OUTLINED:OUTLINED_FUNCTION_4_[0-9]+]]
----------------
Can you add a comment explaining why these functions are not expected?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D71027/new/

https://reviews.llvm.org/D71027





More information about the llvm-commits mailing list