brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.0 KiB · 4a89dfa Raw
85 lines · plain
1; REQUIRES: x862; RUN: llvm-as %s -o %t.o3 4; RUN: rm -f %t.yaml %t1.yaml %t.hot.yaml %t.t300.yaml %t.t301.yaml5; RUN: ld.lld --opt-remarks-filename %t.yaml %t.o -o %t -shared -save-temps6; RUN: llvm-dis %t.0.4.opt.bc -o - | FileCheck %s7; RUN: ld.lld --opt-remarks-with-hotness --opt-remarks-filename %t.hot.yaml \8; RUN:  %t.o -o %t -shared9; RUN: ld.lld --opt-remarks-with-hotness --opt-remarks-hotness-threshold=300 \10; RUN:   --opt-remarks-filename %t.t300.yaml %t.o -o %t -shared11; RUN: ld.lld --opt-remarks-with-hotness --opt-remarks-hotness-threshold=301 \12; RUN:   --opt-remarks-filename %t.t301.yaml %t.o -o %t -shared13; RUN: cat %t.yaml | FileCheck %s -check-prefix=YAML14; RUN: cat %t.hot.yaml | FileCheck %s -check-prefix=YAML-HOT15; RUN: FileCheck %s -check-prefix=YAML-HOT < %t.t300.yaml16; RUN: count 0 < %t.t301.yaml17; RUN: ld.lld --opt-remarks-filename %t1.yaml --opt-remarks-passes inline %t.o \18; RUN: -o /dev/null -shared19; RUN: cat %t1.yaml | FileCheck %s -check-prefix=YAML-PASSES20; RUN: ld.lld --opt-remarks-filename %t1.yaml --opt-remarks-format yaml %t.o \21; RUN: -o /dev/null -shared22; RUN: FileCheck %s -check-prefix=YAML < %t1.yaml23 24; Check that @tinkywinky is inlined after optimizations.25; CHECK-LABEL: define i32 @main26; CHECK-NEXT:  %a.i = {{.*}}call i32 @patatino()27; CHECK-NEXT:  ret i32 %a.i28; CHECK-NEXT: }29 30; YAML:      --- !Passed31; YAML-NEXT: Pass:            inline32; YAML-NEXT: Name:            Inlined33; YAML-NEXT: Function:        main34; YAML-NEXT: Args:35; YAML-NEXT:   - String:          ''''36; YAML-NEXT:   - Callee:          tinkywinky37; YAML-NEXT:   - String:          ''' inlined into '''38; YAML-NEXT:   - Caller:          main39; YAML-NEXT:   - String:          ''''40; YAML-NEXT:   - String:          ' with '41; YAML-NEXT:   - String:          '(cost='42; YAML-NEXT:   - Cost:            '0'43; YAML-NEXT:   - String:          ', threshold='44; YAML-NEXT:   - Threshold:       '337'45; YAML-NEXT:   - String:          ')'46; YAML-NEXT: ...47 48; YAML-HOT:      --- !Passed49; YAML-HOT-NEXT: Pass:            inline50; YAML-HOT-NEXT: Name:            Inlined51; YAML-HOT-NEXT: Function:        main52; YAML-HOT-NEXT: Hotness:         30053; YAML-HOT-NEXT: Args:54; YAML-HOT-NEXT:   - String:          ''''55; YAML-HOT-NEXT:   - Callee:          tinkywinky56; YAML-HOT-NEXT:   - String:          ''' inlined into '''57; YAML-HOT-NEXT:   - Caller:          main58; YAML-HOT-NEXT:   - String:          ''''59; YAML-HOT-NEXT:   - String:          ' with '60; YAML-HOT-NEXT:   - String:          '(cost='61; YAML-HOT-NEXT:   - Cost:            '0'62; YAML-HOT-NEXT:   - String:          ', threshold='63; YAML-HOT-NEXT:   - Threshold:       '337'64; YAML-HOT-NEXT:   - String:          ')'65; YAML-HOT-NEXT: ...66 67; YAML-PASSES: Pass:            inline68 69target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"70target triple = "x86_64-scei-ps4"71 72declare i32 @patatino()73 74define i32 @tinkywinky() {75  %a = call i32 @patatino()76  ret i32 %a77}78 79define i32 @main() !prof !0 {80  %i = call i32 @tinkywinky()81  ret i32 %i82}83 84!0 = !{!"function_entry_count", i64 300}85