Files
TheRock/compiler/amd-llvm/llvm/test/ThinLTO/X86/devirt_single_hybrid.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

81 lines
3.0 KiB
LLVM

; Check that we import and inline virtual method with single implementation
; when we're running hybrid LTO.
;
; RUN: opt -thinlto-bc -thinlto-split-lto-unit %s -o %t-main.bc
; RUN: opt -thinlto-bc -thinlto-split-lto-unit %p/Inputs/devirt_single_hybrid_bar.ll -o %t-bar.bc
; Test the assume(type.test) case.
; RUN: opt -thinlto-bc -thinlto-split-lto-unit %p/Inputs/devirt_single_hybrid_foo.ll -o %t-foo.bc
; RUN: llvm-lto2 run -save-temps %t-main.bc %t-foo.bc %t-bar.bc -pass-remarks=. -o %t \
; RUN: -whole-program-visibility \
; RUN: -r=%t-foo.bc,_Z3fooP1A,pl \
; RUN: -r=%t-main.bc,main,plx \
; RUN: -r=%t-main.bc,_Z3barv,l \
; RUN: -r=%t-bar.bc,_Z3barv,pl \
; RUN: -r=%t-bar.bc,_Z3fooP1A, \
; RUN: -r=%t-bar.bc,_ZNK1A1fEv,pl \
; RUN: -r=%t-bar.bc,_ZTV1A,l \
; RUN: -r=%t-bar.bc,_ZTVN10__cxxabiv117__class_type_infoE, \
; RUN: -r=%t-bar.bc,_ZTS1A,pl \
; RUN: -r=%t-bar.bc,_ZTI1A,pl \
; RUN: -r=%t-bar.bc,_ZNK1A1fEv, \
; RUN: -r=%t-bar.bc,_ZTV1A,pl \
; RUN: -r=%t-bar.bc,_ZTI1A, 2>&1 | FileCheck %s --check-prefix=REMARK
; RUN: llvm-dis %t.1.3.import.bc -o - | FileCheck %s --check-prefix=IMPORT
; RUN: llvm-dis %t.1.5.precodegen.bc -o - | FileCheck %s --check-prefix=CODEGEN
; Test the type.checked.load case.
; RUN: opt -thinlto-bc -thinlto-split-lto-unit %p/Inputs/devirt_single_hybrid_foo_tcl.ll -o %t-foo.bc
; RUN: llvm-lto2 run -save-temps %t-main.bc %t-foo.bc %t-bar.bc -pass-remarks=. -o %t \
; RUN: -whole-program-visibility \
; RUN: -r=%t-foo.bc,_Z3fooP1A,pl \
; RUN: -r=%t-main.bc,main,plx \
; RUN: -r=%t-main.bc,_Z3barv,l \
; RUN: -r=%t-bar.bc,_Z3barv,pl \
; RUN: -r=%t-bar.bc,_Z3fooP1A, \
; RUN: -r=%t-bar.bc,_ZNK1A1fEv,pl \
; RUN: -r=%t-bar.bc,_ZTV1A,l \
; RUN: -r=%t-bar.bc,_ZTVN10__cxxabiv117__class_type_infoE, \
; RUN: -r=%t-bar.bc,_ZTS1A,pl \
; RUN: -r=%t-bar.bc,_ZTI1A,pl \
; RUN: -r=%t-bar.bc,_ZNK1A1fEv, \
; RUN: -r=%t-bar.bc,_ZTV1A,pl \
; RUN: -r=%t-bar.bc,_ZTI1A, 2>&1 | FileCheck %s --check-prefix=REMARK
; RUN: llvm-dis %t.1.3.import.bc -o - | FileCheck %s --check-prefix=IMPORT
; RUN: llvm-dis %t.1.5.precodegen.bc -o - | FileCheck %s --check-prefix=CODEGEN
; REMARK-COUNT-3: single-impl: devirtualized a call to _ZNK1A1fEv
; IMPORT: define available_externally hidden {{(noundef )?}}i32 @_ZNK1A1fEv(ptr %this)
; IMPORT-NEXT: entry:
; IMPORT-NEXT: ret i32 3
; CODEGEN: define hidden {{(noundef )?}}i32 @main()
; CODEGEN-NEXT: entry:
; CODEGEN-NEXT: ret i32 23
; Virtual method should have been optimized out
; CODEGEN-NOT: _ZNK1A1fEv
; ModuleID = 'main.cpp'
source_filename = "main.cpp"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
; Function Attrs: norecurse uwtable
define hidden i32 @main() local_unnamed_addr {
entry:
%call = tail call i32 @_Z3barv()
ret i32 %call
}
declare dso_local i32 @_Z3barv() local_unnamed_addr
!llvm.module.flags = !{!0}
!llvm.ident = !{!1}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{!"clang version 10.0.0 (trunk 373596)"}