[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
Tue Mar 3 13:47:18 PST 2020


jinlin added a comment.

In D71217#1903635 <https://reviews.llvm.org/D71217#1903635>, @paquette wrote:

> The reason you weren't getting outlined functions is probably because there were attributes missing on the function.
>
> I think that we should be able to simplify it further like this:
>
>   # RUN: llc -mtriple=aarch64 -run-pass=machine-outliner -verify-machineinstrs %s -o - | FileCheck %s
>  
>   # The test checks whether the compiler updates the side effect of function @OUTLINED_FUNCTION_0 by adding the use of register x20.
>  
>   --- |
>     declare void @spam() local_unnamed_addr
>     define void @baz() optsize minsize noredzone { ret void }
>   ...
>   ---
>   name:            baz
>   tracksRegLiveness: true
>   body:             |
>     bb.0:
>       liveins: $x0, $x20
>  
>       $x0 = COPY renamable $x20
>       BL @spam, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit $x0, implicit-def $sp, implicit-def $x0
>       renamable $x21 = COPY $x0
>  
>       $x0 = COPY renamable $x20
>       BL @spam, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit $x0, implicit-def $sp, implicit-def $x0
>       renamable $x22 = COPY $x0
>  
>       $x0 = COPY killed renamable $x20
>       BL @spam, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit $x0, implicit-def $sp, implicit-def $x0
>       renamable $x3 = COPY $x0
>  
>       RET_ReallyLR
>  
>   ...
>  
>   # CHECK: BL @OUTLINED_FUNCTION_0, {{.*}}, implicit $x20, {{.*}}
>


Thank you Jessica for helping creating the test case. It is much more simple compared to my old test.


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

https://reviews.llvm.org/D71217





More information about the llvm-commits mailing list