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
79 lines
2.1 KiB
LLVM
79 lines
2.1 KiB
LLVM
; RUN: opt -S --passes=ipsccp,deadargelim --force-specialization < %s | FileCheck %s --check-prefix=NO-GLOBALS
|
|
; RUN: opt -S --passes=ipsccp,deadargelim --force-specialization --funcspec-on-address < %s | FileCheck %s --check-prefix=GLOBALS
|
|
@G = global [10 x i32] zeroinitializer, align 4
|
|
|
|
define internal i32 @f(ptr %p) noinline {
|
|
entry:
|
|
%0 = load i32, ptr %p, align 4
|
|
store i32 0, ptr %p, align 4
|
|
ret i32 %0
|
|
}
|
|
|
|
define internal i32 @g(i32 %x, i32 %y, ptr %p) noinline {
|
|
entry:
|
|
%cmp = icmp sgt i32 %x, %y
|
|
br i1 %cmp, label %if.then, label %if.else
|
|
|
|
if.then:
|
|
br label %if.end
|
|
|
|
if.else:
|
|
br label %if.end
|
|
|
|
if.end:
|
|
%x.addr.0 = phi i32 [ %x, %if.then ], [ 11, %if.else ]
|
|
%p.addr.0 = phi ptr [ @G, %if.then ], [ %p, %if.else ]
|
|
%call = call i32 @f(ptr %p.addr.0)
|
|
%add = add nsw i32 %call, %x.addr.0
|
|
ret i32 %add
|
|
}
|
|
|
|
define i32 @h0(ptr %p) {
|
|
entry:
|
|
%call = call i32 @g(i32 2, i32 1, ptr %p)
|
|
ret i32 %call
|
|
}
|
|
|
|
define i32 @h1() {
|
|
entry:
|
|
%call = call i32 @f(ptr @G)
|
|
ret i32 %call
|
|
}
|
|
|
|
define i32 @h2() {
|
|
entry:
|
|
%call = call i32 @f(ptr getelementptr inbounds (i32, ptr @G, i64 1))
|
|
ret i32 %call
|
|
}
|
|
|
|
; Check if specialisation on the address of a non-const global variable
|
|
; is not allowed, then it is not performed.
|
|
|
|
; NO-GLOBALS-LABEL: define internal range(i32 -2147483646, -2147483648) i32 @g()
|
|
; NO-GLOBALS: call i32 @f(ptr @G)
|
|
|
|
; NO-GLOBALS-LABEL: define range(i32 -2147483646, -2147483648) i32 @h0(ptr %p)
|
|
; NO-GLOBALS:call i32 @g()
|
|
|
|
; NO-GLOBALS-LABEL: define i32 @h1()
|
|
; NO-GLOBALS: call i32 @f(ptr @G)
|
|
|
|
; NO-GLOBALS-LABEL: define i32 @h2()
|
|
; NO-GLOBALS: call i32 @f(ptr getelementptr inbounds (i32, ptr @G, i64 1))
|
|
|
|
; Check if specialisation on the address of a non-const global variable
|
|
; is allowed, then it is performed where possible.
|
|
|
|
; GLOBALS-LABEL: define internal range(i32 -2147483646, -2147483648) i32 @g()
|
|
; GLOBALS: call i32 @f.specialized.2()
|
|
|
|
; GLOBALS-LABEL: define range(i32 -2147483646, -2147483648) i32 @h0(ptr %p)
|
|
; GLOBALS: call i32 @g()
|
|
|
|
; GLOBALS-LABEL: define i32 @h1()
|
|
; GLOBALS: call i32 @f.specialized.2()
|
|
|
|
; GLOBALS-LABEL: define i32 @h2()
|
|
; GLOBALS: call i32 @f.specialized.1()
|
|
|