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

Jin Lin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 2 22:25:58 PST 2020


jinlin marked 5 inline comments as done.
jinlin added inline comments.


================
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
+
----------------
paquette wrote:
> I don't think you need prologepilog for this one
The flag prologepilog is necessary otherwise the machine outlined function will not be generated.


================
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 }>
----------------
paquette wrote:
> 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.
The IR here cannot be deleted since all of them are referenced in the MIR. 

Replacing baz.14 with define void @baz.14() { ret void } does not 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
----------------
paquette wrote:
> Most of this can be deleted, I'm pretty sure.
Removed all unnecessary ones.


================
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
----------------
paquette wrote:
> Are the ADJCALLSTACKs actually necessary here?
Removed.


================
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
----------------
paquette wrote:
> Do you actually have to use calls to get the behaviour you want?
Replaced with parameter.


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

https://reviews.llvm.org/D71217





More information about the llvm-commits mailing list