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
84 lines
2.7 KiB
LLVM
84 lines
2.7 KiB
LLVM
; RUN: llc %s -enable-machine-outliner=never -mtriple=arm64-apple-darwin -o - | FileCheck %s --check-prefix=DARWIN
|
|
; RUN: llc %s -enable-machine-outliner=never -mtriple=arm64-linux-gnu -o - | FileCheck %s --check-prefix=LINUX
|
|
; <rdar://problem/14199482> ARM64: Calls to bzero() replaced with calls to memset()
|
|
|
|
declare void @llvm.memset.p0.i64(ptr nocapture, i8, i64, i1)
|
|
|
|
; CHECK-LABEL: fct1:
|
|
; Constant size memset to zero.
|
|
; DARWIN: {{b|bl}} _bzero
|
|
; LINUX: {{b|bl}} memset
|
|
define void @fct1(ptr nocapture %ptr) minsize {
|
|
tail call void @llvm.memset.p0.i64(ptr %ptr, i8 0, i64 256, i1 false)
|
|
ret void
|
|
}
|
|
|
|
; CHECK-LABEL: fct3:
|
|
; Variable size memset to zero.
|
|
; DARWIN: {{b|bl}} _bzero
|
|
; LINUX: {{b|bl}} memset
|
|
define void @fct3(ptr nocapture %ptr, i32 %unknown) minsize {
|
|
%conv = sext i32 %unknown to i64
|
|
tail call void @llvm.memset.p0.i64(ptr %ptr, i8 0, i64 %conv, i1 false)
|
|
ret void
|
|
}
|
|
|
|
; CHECK-LABEL: fct4:
|
|
; Variable size checked memset to zero.
|
|
; DARWIN: {{b|bl}} _bzero
|
|
; LINUX: {{b|bl}} memset
|
|
define void @fct4(ptr %ptr) minsize {
|
|
%tmp = tail call i64 @llvm.objectsize.i64(ptr %ptr, i1 false)
|
|
%call = tail call ptr @__memset_chk(ptr %ptr, i32 0, i64 256, i64 %tmp)
|
|
ret void
|
|
}
|
|
|
|
declare ptr @__memset_chk(ptr, i32, i64, i64)
|
|
|
|
declare i64 @llvm.objectsize.i64(ptr, i1)
|
|
|
|
; CHECK-LABEL: fct6:
|
|
; Size = unknown, change.
|
|
; DARWIN: {{b|bl}} _bzero
|
|
; LINUX: {{b|bl}} memset
|
|
define void @fct6(ptr %ptr, i32 %unknown) minsize {
|
|
%conv = sext i32 %unknown to i64
|
|
%tmp = tail call i64 @llvm.objectsize.i64(ptr %ptr, i1 false)
|
|
%call = tail call ptr @__memset_chk(ptr %ptr, i32 0, i64 %conv, i64 %tmp)
|
|
ret void
|
|
}
|
|
|
|
; Next functions check that memset is not turned into bzero
|
|
; when the set constant is non-zero, whatever the given size.
|
|
|
|
; CHECK-LABEL: fct7:
|
|
; memset with something that is not a zero, no change.
|
|
; DARWIN: {{b|bl}} _memset
|
|
; LINUX: {{b|bl}} memset
|
|
define void @fct7(ptr %ptr) minsize {
|
|
%tmp = tail call i64 @llvm.objectsize.i64(ptr %ptr, i1 false)
|
|
%call = tail call ptr @__memset_chk(ptr %ptr, i32 1, i64 256, i64 %tmp)
|
|
ret void
|
|
}
|
|
|
|
; CHECK-LABEL: fct8:
|
|
; memset with something that is not a zero, no change.
|
|
; DARWIN: {{b|bl}} _memset
|
|
; LINUX: {{b|bl}} memset
|
|
define void @fct8(ptr %ptr) minsize {
|
|
%tmp = tail call i64 @llvm.objectsize.i64(ptr %ptr, i1 false)
|
|
%call = tail call ptr @__memset_chk(ptr %ptr, i32 1, i64 257, i64 %tmp)
|
|
ret void
|
|
}
|
|
|
|
; CHECK-LABEL: fct9:
|
|
; memset with something that is not a zero, no change.
|
|
; DARWIN: {{b|bl}} _memset
|
|
; LINUX: {{b|bl}} memset
|
|
define void @fct9(ptr %ptr, i32 %unknown) minsize {
|
|
%conv = sext i32 %unknown to i64
|
|
%tmp = tail call i64 @llvm.objectsize.i64(ptr %ptr, i1 false)
|
|
%call = tail call ptr @__memset_chk(ptr %ptr, i32 1, i64 %conv, i64 %tmp)
|
|
ret void
|
|
}
|