115 lines · plain
1; RUN: llvm-as < %s >%t.bc2 3; Check pass remarks emitted to YAML file4; RUN: rm -f %t.yaml5; RUN: llvm-lto2 run -pass-remarks-output=%t.yaml \6; RUN: -pass-remarks-with-hotness \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.bc10; RUN: cat %t.yaml | FileCheck %s -check-prefixes=YAML,YAML-NO-ANNOTATE11 12; Check low threshold allows remarks to emit.13; RUN: rm -f %t.t300.yaml14; RUN: llvm-lto2 run -pass-remarks-output=%t.t300.yaml \15; RUN: -pass-remarks-with-hotness \16; RUN: -pass-remarks-hotness-threshold=300 \17; RUN: -r %t.bc,tinkywinky,p \18; RUN: -r %t.bc,patatino,px \19; RUN: -r %t.bc,main,px -o %t.o %t.bc20; RUN: FileCheck %s -check-prefixes=YAML,YAML-NO-ANNOTATE < %t.t300.yaml21 22; Check high threshold disallows remarks to emit.23; RUN: rm -f %t.t301.yaml24; RUN: llvm-lto2 run -pass-remarks-output=%t.t301.yaml \25; RUN: -pass-remarks-with-hotness \26; RUN: -pass-remarks-hotness-threshold=301 \27; RUN: -r %t.bc,tinkywinky,p \28; RUN: -r %t.bc,patatino,px \29; RUN: -r %t.bc,main,px -o %t.o %t.bc30; RUN: count 0 < %t.t301.yaml31 32; Check pass remarks emitted to stderr33; RUN: llvm-lto2 run -pass-remarks=inline \34; RUN: -pass-remarks-with-hotness \35; RUN: -r %t.bc,tinkywinky,p \36; RUN: -r %t.bc,patatino,px \37; RUN: -r %t.bc,main,px -o %t.o %t.bc 2>&1 | FileCheck %s38 39; Check low threshold allows remarks to emit.40; RUN: llvm-lto2 run -pass-remarks=inline \41; RUN: -pass-remarks-with-hotness \42; RUN: -pass-remarks-hotness-threshold=300 \43; RUN: -r %t.bc,tinkywinky,p \44; RUN: -r %t.bc,patatino,px \45; RUN: -r %t.bc,main,px -o %t.o %t.bc 2>&1 | FileCheck %s46 47; Check high threshold disallows remarks to emit.48; RUN: llvm-lto2 run -pass-remarks=inline \49; RUN: -pass-remarks-with-hotness \50; RUN: -pass-remarks-hotness-threshold=301 \51; RUN: -r %t.bc,tinkywinky,p \52; RUN: -r %t.bc,patatino,px \53; RUN: -r %t.bc,main,px -o %t.o %t.bc 2>&1 | count 054 55; Check that remarks are annotated with LTO phase information with `-annotate-inline-phase`.56; RUN: rm -f %t.yaml57; RUN: llvm-lto2 run -pass-remarks-output=%t.yaml \58; RUN: -pass-remarks-with-hotness \59; RUN: -annotate-inline-phase \60; RUN: -r %t.bc,tinkywinky,p \61; RUN: -r %t.bc,patatino,px \62; RUN: -r %t.bc,main,px -o %t.o %t.bc63; RUN: cat %t.yaml | FileCheck %s -check-prefixes=YAML,YAML-ANNOTATE64 65; Run again with `-annotate-inline-phase`.66; RUN: rm -f %t.t300.yaml67; RUN: llvm-lto2 run -pass-remarks-output=%t.t300.yaml \68; RUN: -pass-remarks-with-hotness \69; RUN: -pass-remarks-hotness-threshold=300 \70; RUN: -annotate-inline-phase \71; RUN: -r %t.bc,tinkywinky,p \72; RUN: -r %t.bc,patatino,px \73; RUN: -r %t.bc,main,px -o %t.o %t.bc74; RUN: FileCheck %s -check-prefixes=YAML,YAML-ANNOTATE < %t.t300.yaml75 76; YAML: --- !Passed77; YAML-NO-ANNOTATE-NEXT: Pass: inline78; YAML-ANNOTATE-NEXT: Pass: postlink-cgscc-inline79 80; YAML-NEXT: Name: Inlined81; YAML-NEXT: Function: main82; YAML-NEXT: Hotness: 30083; YAML-NEXT: Args:84; YAML-NEXT: - String: ''''85; YAML-NEXT: - Callee: tinkywinky86; YAML-NEXT: - String: ''' inlined into '''87; YAML-NEXT: - Caller: main88; YAML-NEXT: - String: ''''89; YAML-NEXT: - String: ' with '90; YAML-NEXT: - String: '(cost='91; YAML-NEXT: - Cost: '-15000'92; YAML-NEXT: - String: ', threshold='93; YAML-NEXT: - Threshold: '337'94; YAML-NEXT: - String: ')'95; YAML-NEXT: ...96 97; CHECK: 'tinkywinky' inlined into 'main' with (cost=-15000, threshold=337) (hotness: 300)98 99target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"100target triple = "x86_64-scei-ps4"101 102declare i32 @patatino()103 104define i32 @tinkywinky() {105 %a = call i32 @patatino()106 ret i32 %a107}108 109define i32 @main() !prof !0 {110 %i = call i32 @tinkywinky()111 ret i32 %i112}113 114!0 = !{!"function_entry_count", i64 300}115