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
69 lines
3.0 KiB
Plaintext
69 lines
3.0 KiB
Plaintext
// RUN: cir-opt %s -cir-to-llvm -o - | FileCheck %s -check-prefix=MLIR
|
|
// RUN: cir-translate %s -cir-to-llvmir --target x86_64-unknown-linux-gnu --disable-cc-lowering | FileCheck %s -check-prefix=LLVM
|
|
|
|
module {
|
|
cir.func @foo() {
|
|
%0 = cir.alloca !cir.float, !cir.ptr<!cir.float>, ["c"] {alignment = 4 : i64}
|
|
%1 = cir.alloca !cir.float, !cir.ptr<!cir.float>, ["d"] {alignment = 4 : i64}
|
|
%2 = cir.alloca !cir.float, !cir.ptr<!cir.float>, ["y", init] {alignment = 4 : i64}
|
|
%3 = cir.alloca !cir.double, !cir.ptr<!cir.double>, ["e"] {alignment = 8 : i64}
|
|
%4 = cir.alloca !cir.double, !cir.ptr<!cir.double>, ["f"] {alignment = 8 : i64}
|
|
%5 = cir.alloca !cir.double, !cir.ptr<!cir.double>, ["g", init] {alignment = 8 : i64}
|
|
%6 = cir.load %0 : !cir.ptr<!cir.float>, !cir.float
|
|
%7 = cir.load %1 : !cir.ptr<!cir.float>, !cir.float
|
|
%8 = cir.mul %6, %7 : !cir.float
|
|
cir.store %8, %2 : !cir.float, !cir.ptr<!cir.float>
|
|
%9 = cir.load %2 : !cir.ptr<!cir.float>, !cir.float
|
|
%10 = cir.load %1 : !cir.ptr<!cir.float>, !cir.float
|
|
%11 = cir.div %9, %10 : !cir.float
|
|
cir.store %11, %2 : !cir.float, !cir.ptr<!cir.float>
|
|
%12 = cir.load %2 : !cir.ptr<!cir.float>, !cir.float
|
|
%13 = cir.load %1 : !cir.ptr<!cir.float>, !cir.float
|
|
%14 = cir.add %12, %13 : !cir.float
|
|
cir.store %14, %2 : !cir.float, !cir.ptr<!cir.float>
|
|
%15 = cir.load %2 : !cir.ptr<!cir.float>, !cir.float
|
|
%16 = cir.load %1 : !cir.ptr<!cir.float>, !cir.float
|
|
%17 = cir.sub %15, %16 : !cir.float
|
|
cir.store %17, %2 : !cir.float, !cir.ptr<!cir.float>
|
|
%18 = cir.load %3 : !cir.ptr<!cir.double>, !cir.double
|
|
%19 = cir.load %4 : !cir.ptr<!cir.double>, !cir.double
|
|
%20 = cir.add %18, %19 : !cir.double
|
|
cir.store %20, %5 : !cir.double, !cir.ptr<!cir.double>
|
|
%21 = cir.load %3 : !cir.ptr<!cir.double>, !cir.double
|
|
%22 = cir.load %4 : !cir.ptr<!cir.double>, !cir.double
|
|
%23 = cir.sub %21, %22 : !cir.double
|
|
cir.store %23, %5 : !cir.double, !cir.ptr<!cir.double>
|
|
%24 = cir.load %3 : !cir.ptr<!cir.double>, !cir.double
|
|
%25 = cir.load %4 : !cir.ptr<!cir.double>, !cir.double
|
|
%26 = cir.mul %24, %25 : !cir.double
|
|
cir.store %26, %5 : !cir.double, !cir.ptr<!cir.double>
|
|
%27 = cir.load %3 : !cir.ptr<!cir.double>, !cir.double
|
|
%28 = cir.load %4 : !cir.ptr<!cir.double>, !cir.double
|
|
%29 = cir.div %27, %28 : !cir.double
|
|
cir.store %29, %5 : !cir.double, !cir.ptr<!cir.double>
|
|
cir.return
|
|
}
|
|
}
|
|
|
|
// MLIR: = llvm.alloca {{.*}} f32 {alignment = 4 : i64} : (i64) -> !llvm.ptr
|
|
// MLIR: = llvm.alloca {{.*}} f64 {alignment = 8 : i64} : (i64) -> !llvm.ptr
|
|
// MLIR: = llvm.fmul {{.*}} : f32
|
|
// MLIR: = llvm.fdiv
|
|
// MLIR: = llvm.fadd
|
|
// MLIR: = llvm.fsub
|
|
// MLIR: = llvm.fadd {{.*}} : f64
|
|
// MLIR: = llvm.fsub
|
|
// MLIR: = llvm.fmul
|
|
// MLIR: = llvm.fdiv
|
|
|
|
// LLVM: = alloca float, i64
|
|
// LLVM: = alloca double, i64
|
|
// LLVM: = fmul float
|
|
// LLVM: = fdiv float
|
|
// LLVM: = fadd float
|
|
// LLVM: = fsub float
|
|
// LLVM: = fadd double
|
|
// LLVM: = fsub double
|
|
// LLVM: = fmul double
|
|
// LLVM: = fdiv double
|