[PATCH] D71217: Fix incorrect logic in maintaining the side-effect of compiler generated outliner functions

Jessica Paquette via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 2 14:56:40 PST 2020


paquette added a comment.

This is a lot better, thank you for adding a MIR testcase! :)

I think that the testcase can be simplified a bit more, but this is very close.



================
Comment at: llvm/test/CodeGen/AArch64/machine-outliner-side-effect.mir:1
+# RUN: llc -mtriple=aarch64--- -run-pass=prologepilog -run-pass=machine-outliner -verify-machineinstrs %s -o - | FileCheck %s
+
----------------
I don't think you need prologepilog for this one


================
Comment at: llvm/test/CodeGen/AArch64/machine-outliner-side-effect.mir:6-45
+  target triple = "aarch64-apple-darwin"
+
+  %0 = type { %1*, i64 }
+  %1 = type { i64 }
+  %2 = type opaque
+  %3 = type <{ %4 }>
+  %4 = type <{ %5 }>
----------------
Most of the IR here can be deleted. Only things that must be directly referenced in the MIR are necessary. (e.g. function calls)

For example, you can replace `baz.14` with just

`define void @baz.14() { ret void }` and it should still work.


================
Comment at: llvm/test/CodeGen/AArch64/machine-outliner-side-effect.mir:60-82
+frameInfo:
+  isFrameAddressTaken: false
+  isReturnAddressTaken: false
+  hasStackMap:     false
+  hasPatchPoint:   false
+  stackSize:       0
+  offsetAdjustment: 0
----------------
Most of this can be deleted, I'm pretty sure.


================
Comment at: llvm/test/CodeGen/AArch64/machine-outliner-side-effect.mir:86
+  bb.0.bb:
+    ADJCALLSTACKDOWN 0, 0, implicit-def dead $sp, implicit $sp
+    BL @barney.16, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit-def $sp, implicit-def $x0
----------------
Are the ADJCALLSTACKs actually necessary here?


================
Comment at: llvm/test/CodeGen/AArch64/machine-outliner-side-effect.mir:87
+    ADJCALLSTACKDOWN 0, 0, implicit-def dead $sp, implicit $sp
+    BL @barney.16, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit-def $sp, implicit-def $x0
+    ADJCALLSTACKUP 0, 0, implicit-def dead $sp, implicit $sp
----------------
Do you actually have to use calls to get the behaviour you want?


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

https://reviews.llvm.org/D71217





More information about the llvm-commits mailing list