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
64 lines
2.5 KiB
LLVM
64 lines
2.5 KiB
LLVM
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
|
|
; RUN: opt -S < %s -passes=gvn | FileCheck %s
|
|
|
|
; Analyze Load from clobbering memset.pattern.
|
|
define i32 @memset_pattern_clobber_load(ptr %p) {
|
|
; CHECK-LABEL: @memset_pattern_clobber_load(
|
|
; CHECK-NEXT: call void @llvm.experimental.memset.pattern.p0.i8.i64(ptr [[P:%.*]], i8 1, i64 8, i1 false)
|
|
; CHECK-NEXT: [[LOAD:%.*]] = load i32, ptr [[P]], align 4
|
|
; CHECK-NEXT: ret i32 [[LOAD]]
|
|
;
|
|
call void @llvm.experimental.memset.pattern.p0.p0.i64(ptr %p, i8 1, i64 8, i1 false)
|
|
%load = load i32, ptr %p
|
|
ret i32 %load
|
|
}
|
|
|
|
define i32 @memset_pattern_clobber_load2(ptr %p) {
|
|
; CHECK-LABEL: @memset_pattern_clobber_load2(
|
|
; CHECK-NEXT: call void @llvm.experimental.memset.pattern.p0.i16.i64(ptr [[P:%.*]], i16 1, i64 8, i1 false)
|
|
; CHECK-NEXT: [[LOAD:%.*]] = load i32, ptr [[P]], align 4
|
|
; CHECK-NEXT: ret i32 [[LOAD]]
|
|
;
|
|
call void @llvm.experimental.memset.pattern(ptr %p, i16 1, i64 8, i1 false)
|
|
%load = load i32, ptr %p
|
|
ret i32 %load
|
|
}
|
|
|
|
define ptr @memset_pattern_clobber_load3(ptr %p) {
|
|
; CHECK-LABEL: @memset_pattern_clobber_load3(
|
|
; CHECK-NEXT: call void @llvm.experimental.memset.pattern.p0.p0.i64(ptr [[P:%.*]], ptr [[P]], i64 8, i1 false)
|
|
; CHECK-NEXT: [[LOAD:%.*]] = load ptr, ptr [[P]], align 8
|
|
; CHECK-NEXT: ret ptr [[LOAD]]
|
|
;
|
|
call void @llvm.experimental.memset.pattern(ptr %p, ptr %p, i64 8, i1 false)
|
|
%load = load ptr, ptr %p
|
|
ret ptr %load
|
|
}
|
|
|
|
define i32 @load_forward_over_memset_pattern(ptr %P, ptr noalias %Q) {
|
|
; CHECK-LABEL: @load_forward_over_memset_pattern(
|
|
; CHECK-NEXT: tail call void @llvm.experimental.memset.pattern.p0.i8.i64(ptr [[P:%.*]], i8 27, i64 8, i1 false)
|
|
; CHECK-NEXT: ret i32 0
|
|
;
|
|
%v1 = load i32, ptr %Q
|
|
tail call void @llvm.experimental.memset.pattern(ptr %P, i8 27, i64 8, i1 false)
|
|
%v2 = load i32, ptr %Q
|
|
%sub = sub i32 %v1, %v2
|
|
ret i32 %sub
|
|
}
|
|
|
|
define i32 @load_forward_over_memset_pattern2(ptr %P, ptr noalias %Q) nounwind ssp {
|
|
; CHECK-LABEL: @load_forward_over_memset_pattern2(
|
|
; CHECK-NEXT: [[V1:%.*]] = load i32, ptr [[Q:%.*]], align 4
|
|
; CHECK-NEXT: tail call void @llvm.experimental.memset.pattern.p0.p0.i64(ptr [[P:%.*]], ptr [[Q]], i64 8, i1 false)
|
|
; CHECK-NEXT: [[V2:%.*]] = load i32, ptr [[Q]], align 4
|
|
; CHECK-NEXT: [[SUB:%.*]] = sub i32 [[V1]], [[V2]]
|
|
; CHECK-NEXT: ret i32 [[SUB]]
|
|
;
|
|
%v1 = load i32, ptr %Q
|
|
tail call void @llvm.experimental.memset.pattern(ptr %P, ptr %Q, i64 8, i1 false)
|
|
%v2 = load i32, ptr %Q
|
|
%sub = sub i32 %v1, %v2
|
|
ret i32 %sub
|
|
}
|