[PATCH] D89485: [MachineOutliner] Do not outline debug instructions

Jessica Paquette via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 2 09:09:52 PST 2020


paquette added inline comments.


================
Comment at: llvm/test/CodeGen/ARM/machine-outliner-remove-debug-instr.mir:1
+# RUN: llc --verify-machineinstrs --run-pass=machine-outliner %s -o - | FileCheck %s
+
----------------
- You can pull the triple into the runline
- Don't need `--` for all of the flags


================
Comment at: llvm/test/CodeGen/ARM/machine-outliner-remove-debug-instr.mir:14
+--- |
+  ; ModuleID = 'x.ll'
+  source_filename = "x.ll"
----------------
Remove comments in the IR


================
Comment at: llvm/test/CodeGen/ARM/machine-outliner-remove-debug-instr.mir:39
+  if.end:                                           ; preds = %entry
+    %mul = mul nsw i32 %a, 11, !dbg !30
+    %sub = sub nsw i32 %mul, %b, !dbg !31
----------------
I don't think you need to include the actual IR here?

This should work:

```
define i32 @h() { ret void }
define i32 @f() { ret void }
define i32 @g() { ret void }
...
```

If it doesn't work, then the MIR is referencing the IR in some way. It may be possible to just drop the references to the IR in the MIR in order to get the simplest test possible.

It would be ideal to end up with something like this:

```
# RUN: ...
--- |
define i32 @h() { ret void }
define i32 @f() { ret void }
define i32 @g() { ret void }
...
---
name:            h
... MIR test ...
```

Or at least as close to the above as possible.


================
Comment at: llvm/test/CodeGen/ARM/machine-outliner-remove-debug-instr.mir:170
+  - { reg: '$r1', virtual-reg: '' }
+frameInfo:
+  isFrameAddressTaken: false
----------------
I don't think most of the entries here are necessary.

I think all you need is something like

```
name:            h
tracksRegLiveness: true
body:             |
```

(see: llvm/test/CodeGen/AArch64/machine-outliner-calls.mir for an example)


================
Comment at: llvm/test/CodeGen/ARM/machine-outliner-remove-debug-instr.mir:199
+
+    DBG_VALUE $r0, $noreg, !13, !DIExpression(), debug-location !15
+    DBG_VALUE $r0, $noreg, !13, !DIExpression(), debug-location !15
----------------
I think you can drop the references to the IR here.

(Judging by llvm/test/CodeGen/AArch64/ldst-opt-mte-with-dbg.mir)


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

https://reviews.llvm.org/D89485



More information about the llvm-commits mailing list