brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.2 KiB · 63f0737 Raw
94 lines · plain
1; RUN: opt -module-summary %s -o %t1.bc2; RUN: opt -module-summary %p/Inputs/diagnostic-handler-remarks.ll -o %t2.bc3 4; Check that the hotness attribute is included in the optimization record file5; with -lto-pass-remarks-with-hotness.6 7; RUN: llvm-lto -thinlto-action=run \8; RUN:          -lto-pass-remarks-output=%t.yaml \9; RUN:          -lto-pass-remarks-with-hotness \10; RUN:          -exported-symbol _func2 \11; RUN:          -exported-symbol _main %t1.bc %t2.bc 2>&1 | \12; RUN:     FileCheck %s -allow-empty13; CHECK-NOT: remark:14; CHECK-NOT: llvm-lto:15 16; Verify that bar is imported 'and' inlined into 'foo'17; RUN: cat %t.yaml.thin.0.yaml | FileCheck %s -check-prefixes=YAML1,YAML1-NO-ANNOTATE18 19; Verify that bar is imported 'and' inlined into 'foo'20; RUN: cat %t.yaml.thin.1.yaml | FileCheck %s -check-prefixes=YAML2,YAML2-NO-ANNOTATE21 22; Run again with -annotate-inline-phase23 24; RUN: llvm-lto -thinlto-action=run \25; RUN:          -lto-pass-remarks-output=%t.yaml \26; RUN:          -annotate-inline-phase \27; RUN:          -lto-pass-remarks-with-hotness \28; RUN:          -exported-symbol _func2 \29; RUN:          -exported-symbol _main %t1.bc %t2.bc 2>&1 | \30; RUN:     FileCheck %s -allow-empty31; CHECK-NOT: remark:32; CHECK-NOT: llvm-lto:33 34; Verify that pass name is annotated with LTO phase information.35; RUN: cat %t.yaml.thin.0.yaml | FileCheck %s -check-prefixes=YAML1,YAML1-ANNOTATE36 37; YAML1:      --- !Passed38; YAML1:      --- !Passed39; YAML1-NO-ANNOTATE-NEXT: Pass: inline40; YAML1-ANNOTATE-NEXT: Pass:   postlink-cgscc-inline41; YAML1-NEXT: Name:            Inlined42; YAML1-NEXT: Function:        main43; YAML1-NEXT: Hotness:         5044; YAML1-NEXT: Args:45; YAML1-NEXT:   - String:          ''''46; YAML1-NEXT:   - Callee:          foo47; YAML1-NEXT:   - String:          ''' inlined into '48; YAML1-NEXT:   - Caller:          main49; YAML1-NEXT:   - String:          ''''50; YAML1-NEXT:   - String:          ' with '51; YAML1-NEXT:   - String:          '(cost='52; YAML1-NEXT:   - Cost:            '-30'53; YAML1-NEXT:   - String:          ', threshold='54; YAML1-NEXT:   - Threshold:       '375'55; YAML1-NEXT:   - String:          ')'56; YAML1-NEXT: ...57 58 59; Verify that bar is imported 'and' inlined into 'foo'60; RUN: cat %t.yaml.thin.1.yaml | FileCheck %s -check-prefixes=YAML2,YAML2-ANNOTATE61; YAML2:      --- !Passed62; YAML2-NO-ANNOTATE-NEXT: Pass:            inline63; YAML2-ANNOTATE-NEXT: Pass:            postlink-cgscc-inline64; YAML2-NEXT: Name:            Inlined65; YAML2-NEXT: Function:        foo66; YAML2-NEXT: Args:67; YAML2-NEXT:   - String:          ''''68; YAML2-NEXT:   - Callee:          bar69; YAML2-NEXT:   - String:          ''' inlined into '70; YAML2-NEXT:   - Caller:          foo71; YAML2-NEXT:   - String:          ''''72; YAML2-NEXT:   - String:          ' with '73; YAML2-NEXT:   - String:          '(cost='74; YAML2-NEXT:   - Cost:            '-30'75; YAML2-NEXT:   - String:          ', threshold='76; YAML2-NEXT:   - Threshold:       '375'77; YAML2-NEXT:   - String:          ')'78; YAML2-NEXT: ...79 80 81target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"82target triple = "x86_64-apple-macosx10.11.0"83 84define i32 @bar() {85	ret i32 4286}87declare i32 @foo()88define i32 @main() !prof !0 {89  %i = call i32 @foo()90  ret i32 %i91}92 93!0 = !{!"function_entry_count", i64 50}94