43 lines · plain
1; This test verifies whether we can outline a singleton instance (i.e., an instance that does not repeat)2; using codegen data that has been read from a previous codegen run.3 4; RUN: split-file %s %t5 6; First, we generate the cgdata file from a local outline instance present in local-two.ll.7; RUN: llc -mtriple=arm64-apple-darwin -enable-machine-outliner -codegen-data-generate=true -filetype=obj %t/local-two.ll -o %t_write8; RUN: llvm-cgdata --merge %t_write -o %t_cgdata9; RUN: llvm-cgdata --show %t_cgdata | FileCheck %s --check-prefix=SHOW10 11; SHOW: Outlined hash tree:12; SHOW-NEXT: Total Node Count: 413; SHOW-NEXT: Terminal Node Count: 114; SHOW-NEXT: Depth: 315 16; Now, we read the cgdata in the machine outliner, enabling us to optimistically17; outline a singleton instance in local-one.ll that matches against the cgdata.18; RUN: llc -mtriple=arm64-apple-darwin -enable-machine-outliner -codegen-data-use-path=%t_cgdata -filetype=obj %t/local-one.ll -o %t_read19; RUN: llvm-objdump -d %t_read | FileCheck %s20 21; CHECK: _OUTLINED_FUNCTION22; CHECK-NEXT: mov23; CHECK-NEXT: mov24; CHECK-NEXT: b25 26;--- local-two.ll27declare i32 @g(i32, i32, i32)28define i32 @f1() minsize {29 %1 = call i32 @g(i32 10, i32 1, i32 2);30 ret i32 %131}32define i32 @f2() minsize {33 %1 = call i32 @g(i32 20, i32 1, i32 2);34 ret i32 %135}36 37;--- local-one.ll38declare i32 @g(i32, i32, i32)39define i32 @f3() minsize {40 %1 = call i32 @g(i32 30, i32 1, i32 2);41 ret i32 %142}43