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
166 lines
4.5 KiB
LLVM
166 lines
4.5 KiB
LLVM
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
|
|
; RUN: opt < %s -passes=instsimplify -S | FileCheck %s
|
|
|
|
@zeroinit = constant {} zeroinitializer
|
|
@poison = constant {} poison
|
|
@constzeroarray = internal constant [4 x i32] zeroinitializer
|
|
|
|
define i32 @crash_on_zeroinit() {
|
|
; CHECK-LABEL: @crash_on_zeroinit(
|
|
; CHECK-NEXT: ret i32 poison
|
|
;
|
|
%load = load i32, ptr @zeroinit
|
|
ret i32 %load
|
|
}
|
|
|
|
define i32 @crash_on_poison() {
|
|
; CHECK-LABEL: @crash_on_poison(
|
|
; CHECK-NEXT: ret i32 poison
|
|
;
|
|
%load = load i32, ptr @poison
|
|
ret i32 %load
|
|
}
|
|
|
|
@GV = private constant [8 x i32] [i32 42, i32 43, i32 44, i32 45, i32 46, i32 47, i32 48, i32 49]
|
|
|
|
define <8 x i32> @partial_load() {
|
|
; CHECK-LABEL: @partial_load(
|
|
; CHECK-NEXT: ret <8 x i32> <i32 0, i32 42, i32 43, i32 44, i32 45, i32 46, i32 47, i32 48>
|
|
;
|
|
%load = load <8 x i32>, ptr getelementptr ([8 x i32], ptr @GV, i64 0, i64 -1)
|
|
ret <8 x i32> %load
|
|
}
|
|
|
|
@constvec = internal constant <3 x float> <float 0xBFDA20BC40000000, float 0xBFE6A09EE0000000, float 0x3FE279A760000000>
|
|
|
|
; This does an out of bounds load from the global constant
|
|
define <3 x float> @load_vec3() {
|
|
; CHECK-LABEL: @load_vec3(
|
|
; CHECK-NEXT: ret <3 x float> poison
|
|
;
|
|
%1 = load <3 x float>, ptr getelementptr inbounds (<3 x float>, ptr @constvec, i64 1)
|
|
ret <3 x float> %1
|
|
}
|
|
|
|
define i32 @load_gep_const_zero_array(i64 %idx) {
|
|
; CHECK-LABEL: @load_gep_const_zero_array(
|
|
; CHECK-NEXT: ret i32 0
|
|
;
|
|
%gep = getelementptr inbounds [4 x i32], ptr @constzeroarray, i64 0, i64 %idx
|
|
%load = load i32, ptr %gep
|
|
ret i32 %load
|
|
}
|
|
|
|
define i8 @load_i8_multi_gep_const_zero_array(i64 %idx1, i64 %idx2) {
|
|
; CHECK-LABEL: @load_i8_multi_gep_const_zero_array(
|
|
; CHECK-NEXT: ret i8 0
|
|
;
|
|
%gep1 = getelementptr inbounds i8, ptr @constzeroarray, i64 %idx1
|
|
%gep = getelementptr inbounds i8, ptr %gep1, i64 %idx2
|
|
%load = load i8, ptr %gep
|
|
ret i8 %load
|
|
}
|
|
|
|
@allones_i32 = constant i32 -1
|
|
|
|
define b8 @load_b8_from_allones_i32() {
|
|
; CHECK-LABEL: @load_b8_from_allones_i32(
|
|
; CHECK-NEXT: ret b8 -1
|
|
;
|
|
%load = load b8, ptr @allones_i32
|
|
ret b8 %load
|
|
}
|
|
|
|
define b8 @load_b8_from_i32_constant() {
|
|
; CHECK-LABEL: @load_b8_from_i32_constant(
|
|
; CHECK-NEXT: ret b8 42
|
|
;
|
|
%load = load b8, ptr @GV
|
|
ret b8 %load
|
|
}
|
|
|
|
define b8 @load_b8_from_fp_constant() {
|
|
; CHECK-LABEL: @load_b8_from_fp_constant(
|
|
; CHECK-NEXT: ret b8 -30
|
|
;
|
|
%load = load b8, ptr @constvec
|
|
ret b8 %load
|
|
}
|
|
|
|
define <4 x b8> @load_vb8_from_allones_gep(i64 %idx) {
|
|
; CHECK-LABEL: @load_vb8_from_allones_gep(
|
|
; CHECK-NEXT: ret <4 x b8> splat (b8 -1)
|
|
;
|
|
%gep = getelementptr i8, ptr @allones_i32, i64 %idx
|
|
%load = load <4 x b8>, ptr %gep
|
|
ret <4 x b8> %load
|
|
}
|
|
|
|
@allones_ptr = constant ptr inttoptr (i64 -1 to ptr)
|
|
@ptr_to_GV = constant ptr @GV
|
|
@struct_inttoptr = constant { ptr, i8 } { ptr inttoptr (i64 -1 to ptr), i8 7 }
|
|
@null_ptr = constant ptr null
|
|
|
|
define b8 @load_b8_from_inttoptr() {
|
|
; CHECK-LABEL: @load_b8_from_inttoptr(
|
|
; CHECK-NEXT: [[LOAD:%.*]] = load b8, ptr @allones_ptr, align 1
|
|
; CHECK-NEXT: ret b8 [[LOAD]]
|
|
;
|
|
%load = load b8, ptr @allones_ptr
|
|
ret b8 %load
|
|
}
|
|
|
|
define <4 x b8> @load_vb8_from_inttoptr() {
|
|
; CHECK-LABEL: @load_vb8_from_inttoptr(
|
|
; CHECK-NEXT: [[LOAD:%.*]] = load <4 x b8>, ptr @allones_ptr, align 4
|
|
; CHECK-NEXT: ret <4 x b8> [[LOAD]]
|
|
;
|
|
%load = load <4 x b8>, ptr @allones_ptr
|
|
ret <4 x b8> %load
|
|
}
|
|
|
|
define <4 x b8> @load_vb8_from_allones_ptr_gep(i64 %idx) {
|
|
; CHECK-LABEL: @load_vb8_from_allones_ptr_gep(
|
|
; CHECK-NEXT: [[GEP:%.*]] = getelementptr i8, ptr @allones_ptr, i64 [[IDX:%.*]]
|
|
; CHECK-NEXT: [[LOAD:%.*]] = load <4 x b8>, ptr [[GEP]], align 4
|
|
; CHECK-NEXT: ret <4 x b8> [[LOAD]]
|
|
;
|
|
%gep = getelementptr i8, ptr @allones_ptr, i64 %idx
|
|
%load = load <4 x b8>, ptr %gep
|
|
ret <4 x b8> %load
|
|
}
|
|
|
|
define b8 @load_b8_from_struct_inttoptr() {
|
|
; CHECK-LABEL: @load_b8_from_struct_inttoptr(
|
|
; CHECK-NEXT: [[LOAD:%.*]] = load b8, ptr @struct_inttoptr, align 1
|
|
; CHECK-NEXT: ret b8 [[LOAD]]
|
|
;
|
|
%load = load b8, ptr @struct_inttoptr
|
|
ret b8 %load
|
|
}
|
|
|
|
define b8 @load_b8_from_struct_after_inttoptr() {
|
|
; CHECK-LABEL: @load_b8_from_struct_after_inttoptr(
|
|
; CHECK-NEXT: ret b8 7
|
|
;
|
|
%gep = getelementptr inbounds i8, ptr @struct_inttoptr, i64 8
|
|
%load = load b8, ptr %gep
|
|
ret b8 %load
|
|
}
|
|
|
|
define b64 @load_b64_from_ptr() {
|
|
; CHECK-LABEL: @load_b64_from_ptr(
|
|
; CHECK-NEXT: ret b64 bitcast (ptr @GV to b64)
|
|
;
|
|
%load = load b64, ptr @ptr_to_GV
|
|
ret b64 %load
|
|
}
|
|
|
|
define b8 @load_b8_from_null_ptr() {
|
|
; CHECK-LABEL: @load_b8_from_null_ptr(
|
|
; CHECK-NEXT: ret b8 0
|
|
;
|
|
%load = load b8, ptr @null_ptr
|
|
ret b8 %load
|
|
}
|