[PATCH] D78062: Adding Comment Annotations to Outlined Functions

Jessica Paquette via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 14 11:16:24 PDT 2020


paquette added inline comments.


================
Comment at: llvm/test/CodeGen/AArch64/machine-outliner-function-annotate.ll:1
+; RUN: llc -verify-machineinstrs -enable-machine-outliner -mtriple=aarch64-linux-gnu < %s | FileCheck %s
+
----------------
AndrewLitteken wrote:
> paquette wrote:
> > Is it possible to write this as a MIR test? In general, MIR tests are better for late passes like the outliner because they let us know exactly which instructions the outliner will work on. With IR tests, we are fragile against other changes in the code generator.
> > 
> > To generate MIR, you can run:
> > 
> > `llc (all the flags you want) -stop-before=machine-outliner -simplify-mir`
> > 
> > Then you can create a testcase with a `RUN` line similar to below:
> > 
> > `llc (all the flags you want) -run-pass=machine-outliner ...`
> > 
> I'm not sure that this works in this case, because the annotations are on the assembly code and don't show up in the MIR. Based on the docs I've found you can't output assembly from MIR.
Oh, yeah, you're right. :)

To output assembly, you can use

```
llc (all the flags you want) -start-before=machine-outliner ...
```

You may also have to add `-enable-machine-outliner`.

This tells llc to start the pass pipeline at the point where the MachineOutliner should run. It will continue the pass pipeline through until emitting assembly.



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

https://reviews.llvm.org/D78062





More information about the llvm-commits mailing list