brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.4 KiB · b6824a0 Raw
91 lines · plain
1; REQUIRES: asserts2; Test workload based importing via -thinlto-pgo-ctx-prof with moving the whole3; graph to a new module.4; Use external linkage symbols so we don't depend on module paths which are5; used when computing the GUIDs of internal linkage symbols.6;7; Set up8; RUN: rm -rf %t9; RUN: mkdir -p %t10; RUN: split-file %s %t11;12; RUN: opt -module-summary -passes=assign-guid,ctx-instr-gen %t/m1.ll -o %t/m1.bc13; RUN: opt -module-summary -passes=assign-guid,ctx-instr-gen %t/m2.ll -o %t/m2.bc14; RUN: opt -module-summary -passes=assign-guid,ctx-instr-gen %t/m3.ll -o %t/m3.bc15; RUN: opt -module-summary -passes=assign-guid,ctx-instr-gen %t/6019442868614718803.ll -o %t/6019442868614718803.bc16 17; RUN: llvm-ctxprof-util fromYAML --input %t/ctxprof.yaml --output %t/ctxprof.bitstream18; RUN: llvm-lto2 run %t/m1.bc %t/m2.bc %t/m3.bc %t/6019442868614718803.bc -thinlto-move-ctxprof-trees \19; RUN:  -o %t/result.o -save-temps \20; RUN:  -use-ctx-profile=%t/ctxprof.bitstream \21; RUN:  -r %t/m1.bc,m1_f1,plx \22; RUN:  -r %t/m2.bc,m2_f1,plx \23; RUN:  -r %t/m3.bc,m1_f1 \24; RUN:  -r %t/m3.bc,m3_f1,plx -debug-only=function-import 2>&1 | FileCheck %s --check-prefix=ABSENT-MSG25 26; also add the move semantics for the root:27; RUN: llvm-lto2 run %t/m1.bc %t/m2.bc %t/m3.bc %t/6019442868614718803.bc -thinlto-move-ctxprof-trees \28; RUN:  -thinlto-move-symbols=6019442868614718803 \29; RUN:  -o %t/result-with-move.o -save-temps \30; RUN:  -use-ctx-profile=%t/ctxprof.bitstream \31; RUN:  -r %t/m1.bc,m1_f1,plx \32; RUN:  -r %t/m2.bc,m2_f1,plx \33; RUN:  -r %t/m3.bc,m1_f1 \34; RUN:  -r %t/m3.bc,m3_f1,plx -debug-only=function-import 2>&1 | FileCheck %s --check-prefix=ABSENT-MSG35 36; RUN: llvm-dis %t/result.o.4.3.import.bc -o - | FileCheck %s37; RUN: llvm-dis %t/result.o.3.3.import.bc -o - | FileCheck %s --check-prefix=ABSENT38; RUN: llvm-dis %t/result-with-move.o.1.3.import.bc -o - | FileCheck %s --check-prefix=WITHMOVE-SRC39; RUN: llvm-dis %t/result-with-move.o.4.3.import.bc -o - | FileCheck %s --check-prefix=WITHMOVE-DEST40; RUN: llvm-dis %t/result.o.1.3.import.bc -o - | FileCheck %s --check-prefix=WITHOUTMOVE-SRC41;42; CHECK: define available_externally void @m1_f1()43; CHECK: define available_externally void @m2_f1()44; ABSENT: declare void @m1_f1()45; ABSENT-MSG: Skipping over 6019442868614718803 because its import is handled in a different module.46;47; WITHMOVE-SRC: declare dso_local void @m1_f148; WITHMOVE-DEST: define dso_local void @m1_f149; WITHOUTMOVE-SRC: define dso_local void @m1_f150;--- ctxprof.yaml51Contexts: 52  -53    Guid: 601944286861471880354    TotalRootEntryCount: 555    Counters: [1]56    Callsites:  57      - -58          Guid: 1559309627467091975459          Counters: [1]60 61;--- m1.ll62target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"63target triple = "x86_64-pc-linux-gnu"64 65define dso_local void @m1_f1() {66  ret void67}68 69;--- m2.ll70target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"71target triple = "x86_64-pc-linux-gnu"72 73define dso_local void @m2_f1() {74  ret void75}76 77;--- m3.ll78target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"79target triple = "x86_64-pc-linux-gnu"80 81declare void @m1_f1()82 83define dso_local void @m3_f1() {84  call void @m1_f1()85  ret void86}87 88;--- 6019442868614718803.ll89target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"90target triple = "x86_64-pc-linux-gnu"91