brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.8 KiB · 7fe6019 Raw
53 lines · plain
1; Test to ensure -fdiagnostics-show-hotness and -fsave-optimization-record2; work when invoking the ThinLTO backend path.3; REQUIRES: x86-registered-target4 5; RUN: opt -module-summary -o %t.o %s6; RUN: llvm-lto -thinlto -o %t %t.o7 8; First try YAML pass remarks file9; RUN: rm -f %t2.opt.yaml10; RUN: %clang -target x86_64-scei-ps4 -O2 -x ir %t.o -fthinlto-index=%t.thinlto.bc -fsave-optimization-record -fdiagnostics-show-hotness -o %t2.o -c11; RUN: cat %t2.opt.yaml | FileCheck %s -check-prefix=YAML12 13; YAML: --- !Passed14; YAML-NEXT: Pass:            inline15; YAML-NEXT: Name:            Inlined16; YAML-NEXT: Function:        main17; YAML-NEXT: Hotness:         30018; YAML-NEXT: Args:19; YAML-NEXT:   - String:          ''''20; YAML-NEXT:   - Callee:          tinkywinky21; YAML-NEXT:   - String:          ''' inlined into '''22; YAML-NEXT:   - Caller:          main23; YAML-NEXT:   - String:          ''''24; YAML-NEXT:   - String:          ' with '25; YAML-NEXT:   - String:          '(cost='26; YAML-NEXT:   - Cost:            '0'27; YAML-NEXT:   - String:          ', threshold='28; YAML-NEXT:   - Threshold:       '337'29; YAML-NEXT:   - String:          ')'30; YAML-NEXT: ...31 32; Next try with pass remarks to stderr33; RUN: %clang -target x86_64-scei-ps4 -O2 -x ir %t.o -fthinlto-index=%t.thinlto.bc -Rpass=inline -fdiagnostics-show-hotness -o %t2.o -c 2>&1 | FileCheck %s34 35; CHECK: 'tinkywinky' inlined into 'main' with (cost=0, threshold=337) (hotness: 300)36 37target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"38target triple = "x86_64-scei-ps4"39 40declare i32 @patatino()41 42define i32 @tinkywinky() {43  %a = call i32 @patatino()44  ret i32 %a45}46 47define i32 @main() !prof !0 {48  %i = call i32 @tinkywinky()49  ret i32 %i50}51 52!0 = !{!"function_entry_count", i64 300}53