Files
TheRock/compiler/amd-llvm/llvm/test/Transforms/Util/call-promotion-utils-ptrcast.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

51 lines
1.3 KiB
LLVM

; RUN: opt -S -passes=pgo-icall-prom -icp-total-percent-threshold=0 -icp-max-prom=4 < %s 2>&1 | FileCheck %s
; Test that CallPromotionUtils will promote calls which require pointer casts.
@foo = common global ptr null, align 8
; Check ptrcast arguments.
define i64 @func1(ptr %a) {
ret i64 undef
}
; Check ptrcast return.
define ptr @func2(i64 %a) {
ret ptr undef
}
; Check ptrcast arguments and return.
define ptr @func3(ptr %a) {
ret ptr undef
}
; Check mixed ptrcast and bitcast.
define ptr @func4(double %f) {
ret ptr undef
}
define i64 @bar() {
%tmp = load ptr, ptr @foo, align 8
; CHECK: [[ARG:%[0-9]+]] = bitcast i64 1 to double
; CHECK-NEXT: [[RET:%[0-9]+]] = call ptr @func4(double [[ARG]])
; CHECK-NEXT: ptrtoint ptr [[RET]] to i64
; CHECK: [[RET:%[0-9]+]] = call ptr @func2(i64 1)
; CHECK-NEXT: ptrtoint ptr [[RET]] to i64
; CHECK: [[ARG:%[0-9]+]] = inttoptr i64 1 to ptr
; CHECK-NEXT: [[RET:%[0-9]+]] = call ptr @func3(ptr [[ARG]])
; CHECK-NEXT: ptrtoint ptr [[RET]] to i64
; CHECK: [[ARG:%[0-9]+]] = inttoptr i64 1 to ptr
; CHECK-NEXT: call i64 @func1(ptr [[ARG]])
; CHECK-NOT: ptrtoint
; CHECK-NOT: bitcast
%call = call i64 %tmp(i64 1), !prof !1
ret i64 %call
}
!1 = !{!"VP", i32 0, i64 1600, i64 7651369219802541373, i64 1030, i64 -4377547752858689819, i64 410, i64 -6929281286627296573, i64 150, i64 -2545542355363006406, i64 10}