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
124 lines
2.8 KiB
LLVM
124 lines
2.8 KiB
LLVM
; RUN: opt < %s -passes=lower-atomic -S | FileCheck %s
|
|
|
|
define i8 @add() {
|
|
; CHECK-LABEL: @add(
|
|
%i = alloca i8
|
|
%j = atomicrmw add ptr %i, i8 42 monotonic
|
|
; CHECK: [[INST:%[a-z0-9]+]] = load
|
|
; CHECK-NEXT: add
|
|
; CHECK-NEXT: store
|
|
ret i8 %j
|
|
; CHECK: ret i8 [[INST]]
|
|
}
|
|
|
|
define i8 @nand() {
|
|
; CHECK-LABEL: @nand(
|
|
%i = alloca i8
|
|
%j = atomicrmw nand ptr %i, i8 42 monotonic
|
|
; CHECK: [[INST:%[a-z0-9]+]] = load
|
|
; CHECK-NEXT: and
|
|
; CHECK-NEXT: xor
|
|
; CHECK-NEXT: store
|
|
ret i8 %j
|
|
; CHECK: ret i8 [[INST]]
|
|
}
|
|
|
|
define i8 @min() {
|
|
; CHECK-LABEL: @min(
|
|
%i = alloca i8
|
|
%j = atomicrmw min ptr %i, i8 42 monotonic
|
|
; CHECK: [[INST:%[a-z0-9]+]] = load
|
|
; CHECK-NEXT: icmp
|
|
; CHECK-NEXT: select
|
|
; CHECK-NEXT: store
|
|
ret i8 %j
|
|
; CHECK: ret i8 [[INST]]
|
|
}
|
|
|
|
define float @fadd() {
|
|
; CHECK-LABEL: @fadd(
|
|
%i = alloca float
|
|
%j = atomicrmw fadd ptr %i, float 42.0 monotonic
|
|
; CHECK: [[INST:%[a-z0-9]+]] = load
|
|
; CHECK-NEXT: fadd
|
|
; CHECK-NEXT: store
|
|
ret float %j
|
|
; CHECK: ret float [[INST]]
|
|
}
|
|
|
|
define float @fsub() {
|
|
; CHECK-LABEL: @fsub(
|
|
%i = alloca float
|
|
%j = atomicrmw fsub ptr %i, float 42.0 monotonic
|
|
; CHECK: [[INST:%[a-z0-9]+]] = load
|
|
; CHECK-NEXT: fsub
|
|
; CHECK-NEXT: store
|
|
ret float %j
|
|
; CHECK: ret float [[INST]]
|
|
}
|
|
|
|
define float @fmax() {
|
|
; CHECK-LABEL: @fmax(
|
|
%i = alloca float
|
|
%j = atomicrmw fmax ptr %i, float 42.0 monotonic
|
|
; CHECK: [[INST:%[a-z0-9]+]] = load
|
|
; CHECK-NEXT: call float @llvm.maxnum.f32
|
|
; CHECK-NEXT: store
|
|
ret float %j
|
|
; CHECK: ret float [[INST]]
|
|
}
|
|
|
|
define float @fmin() {
|
|
; CHECK-LABEL: @fmin(
|
|
%i = alloca float
|
|
%j = atomicrmw fmin ptr %i, float 42.0 monotonic
|
|
; CHECK: [[INST:%[a-z0-9]+]] = load
|
|
; CHECK-NEXT: call float @llvm.minnum.f32
|
|
; CHECK-NEXT: store
|
|
ret float %j
|
|
; CHECK: ret float [[INST]]
|
|
}
|
|
|
|
define float @fmaximum() {
|
|
; CHECK-LABEL: @fmaximum(
|
|
%i = alloca float
|
|
%j = atomicrmw fmaximum ptr %i, float 42.0 monotonic
|
|
; CHECK: [[INST:%[a-z0-9]+]] = load
|
|
; CHECK-NEXT: call float @llvm.maximum.f32
|
|
; CHECK-NEXT: store
|
|
ret float %j
|
|
; CHECK: ret float [[INST]]
|
|
}
|
|
|
|
define float @fminimum() {
|
|
; CHECK-LABEL: @fminimum(
|
|
%i = alloca float
|
|
%j = atomicrmw fminimum ptr %i, float 42.0 monotonic
|
|
; CHECK: [[INST:%[a-z0-9]+]] = load
|
|
; CHECK-NEXT: call float @llvm.minimum.f32
|
|
; CHECK-NEXT: store
|
|
ret float %j
|
|
; CHECK: ret float [[INST]]
|
|
}
|
|
|
|
define <2 x half> @fmaximum_2xhalf(<2 x half> %val) {
|
|
; CHECK-LABEL: @fmaximum_2xhalf(
|
|
%i = alloca <2 x half>, align 4
|
|
%j = atomicrmw fmaximum ptr %i, <2 x half> %val monotonic
|
|
; CHECK: [[INST:%[a-z0-9]+]] = load
|
|
; CHECK-NEXT: call <2 x half> @llvm.maximum.v2f16
|
|
; CHECK-NEXT: store
|
|
ret <2 x half> %j
|
|
}
|
|
|
|
define <2 x half> @fminimum_2xhalf(<2 x half> %val) {
|
|
; CHECK-LABEL: @fminimum_2xhalf(
|
|
%i = alloca <2 x half>, align 4
|
|
%j = atomicrmw fminimum ptr %i, <2 x half> %val monotonic
|
|
; CHECK: [[INST:%[a-z0-9]+]] = load
|
|
; CHECK-NEXT: call <2 x half> @llvm.minimum.v2f16
|
|
; CHECK-NEXT: store
|
|
ret <2 x half> %j
|
|
}
|
|
|