Files
TheRock/compiler/amd-llvm/llvm/test/ThinLTO/X86/distributed_import.ll
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

96 lines
3.7 KiB
LLVM

; Test distributed build thin link output from llvm-lto2
; Generate bitcode files with summary, as well as minimized bitcode containing just the summary
; RUN: opt -thinlto-bc %s -thin-link-bitcode-file=%t1.thinlink.bc -o %t1.bc
; RUN: opt -thinlto-bc %p/Inputs/distributed_import.ll -thin-link-bitcode-file=%t2.thinlink.bc -o %t2.bc
; RUN: llvm-bcanalyzer -dump %t1.thinlink.bc | FileCheck --check-prefix=THINLINKBITCODE %s
; First perform the thin link on the normal bitcode file.
; RUN: llvm-lto2 run %t1.bc %t2.bc -o %t.o -save-temps \
; RUN: -thinlto-distributed-indexes \
; RUN: -r=%t1.bc,g, \
; RUN: -r=%t1.bc,analias, \
; RUN: -r=%t1.bc,f,px \
; RUN: -r=%t2.bc,g,px \
; RUN: -r=%t2.bc,analias,px \
; RUN: -r=%t2.bc,aliasee,px
; RUN: opt -passes=function-import -import-all-index -enable-import-metadata -summary-file %t1.bc.thinlto.bc %t1.bc -o %t1.out
; RUN: opt -passes=function-import -import-all-index -summary-file %t2.bc.thinlto.bc %t2.bc -o %t2.out
; RUN: llvm-dis -o - %t1.out | FileCheck %s --check-prefix=IMPORT
; RUN: llvm-dis -o - %t2.out | FileCheck %s --check-prefix=EXPORT
; Save the generated index files.
; RUN: cp %t1.bc.thinlto.bc %t1.bc.thinlto.bc.orig
; RUN: cp %t2.bc.thinlto.bc %t2.bc.thinlto.bc.orig
; Copy the minimized bitcode to the regular bitcode path so the module
; paths in the index are the same (save the regular bitcode for use again
; further down).
; RUN: cp %t1.bc %t1.bc.sv
; RUN: cp %t1.thinlink.bc %t1.bc
; RUN: cp %t2.bc %t2.bc.sv
; RUN: cp %t2.thinlink.bc %t2.bc
; Next perform the thin link on the minimized bitcode files, and compare dumps
; of the resulting indexes to the above dumps to ensure they are identical.
; RUN: rm -f %t1.bc.thinlto.bc %t2.bc.thinlto.bc
; RUN: llvm-lto2 run %t1.bc %t2.bc -o %t.o -save-temps \
; RUN: -thinlto-distributed-indexes \
; RUN: -r=%t1.bc,g, \
; RUN: -r=%t1.bc,analias, \
; RUN: -r=%t1.bc,f,px \
; RUN: -r=%t2.bc,g,px \
; RUN: -r=%t2.bc,analias,px \
; RUN: -r=%t2.bc,aliasee,px
; RUN: diff %t1.bc.thinlto.bc.orig %t1.bc.thinlto.bc
; RUN: diff %t2.bc.thinlto.bc.orig %t2.bc.thinlto.bc
; Make sure importing occurs as expected
; RUN: cp %t1.bc.sv %t1.bc
; RUN: cp %t2.bc.sv %t2.bc
; RUN: opt -passes=function-import -import-all-index -enable-import-metadata -summary-file %t1.bc.thinlto.bc %t1.bc -o %t1.out
; RUN: opt -passes=function-import -import-all-index -summary-file %t2.bc.thinlto.bc %t2.bc -o %t2.out
; RUN: llvm-dis -o - %t1.out | FileCheck %s --check-prefix=IMPORT
; RUN: llvm-dis -o - %t2.out | FileCheck %s --check-prefix=EXPORT
; IMPORT: define available_externally i32 @g() !thinlto_src_module
; IMPORT: define available_externally void @analias() !thinlto_src_module
; EXPORT: @G.llvm.
target triple = "x86_64-unknown-linux-gnu"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
declare i32 @g(...)
declare void @analias(...)
define void @f() {
entry:
call i32 (...) @g()
call void (...) @analias()
ret void
}
; THINLINKBITCODE-NOT: IDENTIFICATION_BLOCK_ID
; THINLINKBITCODE-NOT: BLOCKINFO_BLOCK
; THINLINKBITCODE-NOT: TYPE_BLOCK_ID
; THINLINKBITCODE-NOT: VSTOFFSET
; THINLINKBITCODE-NOT: CONSTANTS_BLOCK
; THINLINKBITCODE-NOT: METADATA_KIND_BLOCK
; THINLINKBITCODE-NOT: METADATA_BLOCK
; THINLINKBITCODE-NOT: OPERAND_BUNDLE_TAGS_BLOCK
; THINLINKBITCODE-NOT: UnknownBlock26
; THINLINKBITCODE-NOT: FUNCTION_BLOCK
; THINLINKBITCODE-NOT: VALUE_SYMTAB
; THINLINKBITCODE: MODULE_BLOCK
; THINLINKBITCODE: VERSION
; THINLINKBITCODE: SOURCE_FILENAME
; THINLINKBITCODE: GLOBALVAL_SUMMARY_BLOCK
; THINLINKBITCODE: HASH
; THINLINKBITCODE: SYMTAB_BLOCK
; THINLINKBITCODE: STRTAB_BLOCK
!llvm.dbg.cu = !{}
!1 = !{i32 2, !"Debug Info Version", i32 3}
!llvm.module.flags = !{!1}