Home | History | Annotate | Download | only in X86
      1 ; Test of LTO with opt remarks YAML output.
      2 
      3 ; First try with Regular LTO
      4 ; RUN: llvm-as < %s >%t.bc
      5 ; RUN: rm -f %t.yaml
      6 ; RUN: llvm-lto2 run -pass-remarks-output=%t.yaml \
      7 ; RUN:           -r %t.bc,tinkywinky,p \
      8 ; RUN:           -r %t.bc,patatino,px \
      9 ; RUN:           -r %t.bc,main,px -o %t.o %t.bc
     10 ; RUN: cat %t.yaml | FileCheck %s -check-prefix=YAML
     11 
     12 ; Try again with ThinLTO
     13 ; RUN: opt -module-summary %s -o %t.bc
     14 ; RUN: rm -f %t.thin.1.yaml
     15 ; RUN: llvm-lto2 run -pass-remarks-output=%t \
     16 ; RUN:           -r %t.bc,tinkywinky,p \
     17 ; RUN:           -r %t.bc,patatino,px \
     18 ; RUN:           -r %t.bc,main,px -o %t.o %t.bc
     19 ; RUN: cat %t.thin.1.yaml | FileCheck %s -check-prefix=YAML
     20 
     21 ; YAML:      --- !Passed
     22 ; YAML-NEXT: Pass:            inline
     23 ; YAML-NEXT: Name:            Inlined
     24 ; YAML-NEXT: Function:        main
     25 ; YAML-NEXT: Args:
     26 ; YAML-NEXT:   - Callee:          tinkywinky
     27 ; YAML-NEXT:   - String:          ' inlined into '
     28 ; YAML-NEXT:   - Caller:          main
     29 ; YAML-NEXT:   - String:          ' with cost='
     30 ; YAML-NEXT:   - Cost:            '-15000'
     31 ; YAML-NEXT:   - String:          ' (threshold='
     32 ; YAML-NEXT:   - Threshold:       '337'
     33 ; YAML-NEXT:   - String:          ')'
     34 ; YAML-NEXT: ...
     35 
     36 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
     37 target triple = "x86_64-scei-ps4"
     38 
     39 declare i32 @patatino()
     40 
     41 define i32 @tinkywinky() {
     42   %a = call i32 @patatino()
     43   ret i32 %a
     44 }
     45 
     46 define i32 @main() {
     47   %i = call i32 @tinkywinky()
     48   ret i32 %i
     49 }
     50