brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.7 KiB · e7f7de2 Raw
79 lines · plain
1; Test of LTO with opt remarks YAML output.2 3; First try with Regular LTO4; RUN: llvm-as < %s >%t.bc5; RUN: rm -f %t.yaml6; RUN: llvm-lto2 run -pass-remarks-output=%t.yaml \7; RUN:           -pass-remarks-filter=inline \8; RUN:           -r %t.bc,tinkywinky,p \9; RUN:           -r %t.bc,patatino,px \10; RUN:           -r %t.bc,main,px -o %t.o %t.bc11; RUN: cat %t.yaml | FileCheck %s -check-prefixes=YAML,YAML-NO-ANNOTATE12 13; Try again with ThinLTO14; RUN: opt -module-summary %s -o %t.bc15; RUN: rm -f %t.thin.1.yaml16; RUN: llvm-lto2 run -pass-remarks-output=%t \17; RUN:           -pass-remarks-filter=inline \18; RUN:           -r %t.bc,tinkywinky,p \19; RUN:           -r %t.bc,patatino,px \20; RUN:           -r %t.bc,main,px -o %t.o %t.bc21; RUN: cat %t.thin.1.yaml | FileCheck %s -check-prefixes=YAML,YAML-NO-ANNOTATE22 23; Check that remarks are annotated with LTO phase information with `-annotate-inline-phase`.24; First try with Regular LTO25; RUN: llvm-as < %s >%t.bc26; RUN: rm -f %t.yaml27; RUN: llvm-lto2 run -pass-remarks-output=%t.yaml \28; RUN:           -pass-remarks-filter=inline \29; RUN:           -annotate-inline-phase \30; RUN:           -r %t.bc,tinkywinky,p \31; RUN:           -r %t.bc,patatino,px \32; RUN:           -r %t.bc,main,px -o %t.o %t.bc33; RUN: cat %t.yaml | FileCheck %s -check-prefixes=YAML,YAML-POSTLINK-LTO34 35; Try again with ThinLTO36; RUN: opt -module-summary %s -o %t.bc37; RUN: rm -f %t.thin.1.yaml38; RUN: llvm-lto2 run -pass-remarks-output=%t \39; RUN:           -pass-remarks-filter=inline \40; RUN:           -annotate-inline-phase \41; RUN:           -r %t.bc,tinkywinky,p \42; RUN:           -r %t.bc,patatino,px \43; RUN:           -r %t.bc,main,px -o %t.o %t.bc44; RUN: cat %t.thin.1.yaml | FileCheck %s -check-prefixes=YAML,YAML-POSTLINK-LTO45 46; YAML:      --- !Passed47; YAML-NO-ANNOTATE: Pass:         inline48; YAML-POSTLINK-LTO-NEXT: Pass:            postlink-cgscc-inline49; YAML-NEXT: Name:            Inlined50; YAML-NEXT: Function:        main51; YAML-NEXT: Args:52; YAML-NEXT:   - String:          ''''53; YAML-NEXT:   - Callee:          tinkywinky54; YAML-NEXT:   - String:          ''' inlined into '''55; YAML-NEXT:   - Caller:          main56; YAML-NEXT:   - String:          ''''57; YAML-NEXT:   - String:          ' with '58; YAML-NEXT:   - String:          '(cost='59; YAML-NEXT:   - Cost:            '-15000'60; YAML-NEXT:   - String:          ', threshold='61; YAML-NEXT:   - Threshold:       '337'62; YAML-NEXT:   - String:          ')'63; YAML-NEXT: ...64 65target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"66target triple = "x86_64-scei-ps4"67 68declare i32 @patatino()69 70define i32 @tinkywinky() {71  %a = call i32 @patatino()72  ret i32 %a73}74 75define i32 @main() {76  %i = call i32 @tinkywinky()77  ret i32 %i78}79