[PATCH] D79070: [NFCi] Iterative Outliner + clang-format refactoring.

Jessica Paquette via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 29 11:16:37 PDT 2020


paquette added inline comments.


================
Comment at: llvm/lib/CodeGen/MachineOutliner.cpp:100
 
-// Set the number of times to repeatedly apply outlining.
-// Defaults to 1, but more repetitions can save additional size.
-static cl::opt<unsigned>
-    NumRepeat("machine-outline-runs", cl::Hidden,
-              cl::desc("The number of times to apply machine outlining"),
-              cl::init(1));
+/// Number if times to re-run the outliner. This is not the total runs as the
+/// outliner will run at least one time. Default value is set to 0, meaning the
----------------
- s/if/of/
- total number of runs


================
Comment at: llvm/test/CodeGen/AArch64/machine-outliner-iterative-2.mir:20
+  }
+  attributes #0 = { noredzone minsize }
+...
----------------
noredzone can be passed in MachineModuleInfo now, so you shouldn't need any IR.

see llvm/test/CodeGen/AArch64/function-info-noredzone-present.ll for an example


================
Comment at: llvm/test/CodeGen/AArch64/machine-outliner-iterative-2.mir:25
+#ITER1:      $w19 = ORRWrs $wzr, killed $w0, 0
+#ITER1-NEXT: BL @OUTLINED_FUNCTION_0
+#ITER1-NEXT: $w1 = ORRWri $wzr, 1
----------------
Maybe it would be better to do this with a regex?
e.g.

`BL @OUTLINED_FUNCTION_[[FUNC1:[0-9]+]]`


================
Comment at: llvm/test/CodeGen/AArch64/machine-outliner-iterative-2.mir:41-49
+liveins:
+  - { reg: '$w0', virtual-reg: '' }
+stack:
+  - { id: 0, name: '', type: spill-slot, offset: -8, size: 8, alignment: 8,
+      stack-id: default, callee-saved-register: '$lr', callee-saved-restored: true,
+      debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
+  - { id: 1, name: '', type: spill-slot, offset: -16, size: 8, alignment: 8,
----------------
can just delete this I think


================
Comment at: llvm/test/CodeGen/AArch64/machine-outliner-iterative-2.mir:50
+      debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
+constants:       []
+body:             |
----------------
can just delete this too I think


================
Comment at: llvm/test/CodeGen/AArch64/machine-outliner-iterative-2.mir:55
+
+    early-clobber $sp = frame-setup STPXpre killed $x19, killed $lr, $sp, -2 :: (store 8 into %stack.1), (store 8 into %stack.0)
+    $w19 = ORRWrs $wzr, killed $w0, 0
----------------
If you change everything this: 

```
(store 8 into %stack.1)
```

into this:

```
(store 8)
```

you can remove some references to the IR. This, in combination with putting the redzone attribute in the MIR, should allow you to delete the IR entirely.


================
Comment at: llvm/test/CodeGen/AArch64/machine-outliner-iterative-2.mir:93-102
+liveins:
+  - { reg: '$w0', virtual-reg: '' }
+stack:
+  - { id: 0, name: '', type: spill-slot, offset: -8, size: 8, alignment: 8,
+      stack-id: default, callee-saved-register: '$lr', callee-saved-restored: true,
+      debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
+  - { id: 1, name: '', type: spill-slot, offset: -16, size: 8, alignment: 8,
----------------
can probably just delete this


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D79070





More information about the llvm-commits mailing list