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
53 lines
2.6 KiB
MLIR
53 lines
2.6 KiB
MLIR
/// Verify that converts are only generated correctly without declare ops
|
|
|
|
// RUN: fir-opt %s --fir-to-memref --allow-unregistered-dialect | FileCheck %s
|
|
|
|
// CHECK-LABEL: func.func @nodeclare
|
|
// CHECK: %[[C1:.*]] = arith.constant 1 : index
|
|
// CHECK: %[[SHAPE:.*]] = fir.shape %[[C1]] : (index) -> !fir.shape<1>
|
|
// CHECK: %[[M0:.*]] = fir.convert %arg0 : (!fir.ref<!fir.array<1xi32>>) -> memref<1xi32>
|
|
// CHECK: %[[M1:.*]] = fir.convert %arg0 : (!fir.ref<!fir.array<1xi32>>) -> memref<1xi32>
|
|
// CHECK: %[[L0:.*]] = memref.load %[[M0]][%{{.*}}] : memref<1xi32>
|
|
// CHECK: %[[CARG1:.*]] = fir.convert %arg1 : (!fir.ref<i32>) -> memref<i32>
|
|
// CHECK: memref.store %[[L0]], %[[CARG1]][] : memref<i32>
|
|
// CHECK: %[[L1:.*]] = memref.load %[[M1]][%{{.*}}] : memref<1xi32>
|
|
// CHECK: %[[CARG2:.*]] = fir.convert %arg2 : (!fir.ref<i32>) -> memref<i32>
|
|
// CHECK: memref.store %[[L1]], %[[CARG2]][] : memref<i32>
|
|
// CHECK-NOT: fir.array_coor
|
|
|
|
func.func @nodeclare(%arg0: !fir.ref<!fir.array<1xi32>> {fir.bindc_name = "a"}, %arg1: !fir.ref<i32> {fir.bindc_name = "b"}, %arg2: !fir.ref<i32> {fir.bindc_name = "c"}) attributes {fir.internal_name = ""} {
|
|
%c1 = arith.constant 1 : index
|
|
%shape = fir.shape %c1 : (index) -> !fir.shape<1>
|
|
%0 = fir.array_coor %arg0(%shape) %c1 : (!fir.ref<!fir.array<1xi32>>, !fir.shape<1>, index) -> !fir.ref<i32>
|
|
%1 = fir.load %0 : !fir.ref<i32>
|
|
fir.store %1 to %arg1 : !fir.ref<i32>
|
|
%2 = fir.load %0 : !fir.ref<i32>
|
|
fir.store %2 to %arg2 : !fir.ref<i32>
|
|
return
|
|
}
|
|
|
|
// CHECK-LABEL: func.func @nodeclare_regions
|
|
// CHECK-COUNT-4: fir.convert %{{.*}} : (!fir.ref<!fir.array<6xi32>>) -> memref<6xi32>
|
|
// CHECK-COUNT-1: fir.convert %{{.*}} : (i32) -> f32
|
|
// CHECK-NOT: fir.array_coor
|
|
|
|
func.func @nodeclare_regions(%arg0: !fir.ref<!fir.array<10xf32>> {fir.bindc_name = "h11"}, %arg1: !fir.ref<!fir.array<6xi32>> {fir.bindc_name = "rslt"}) attributes {fir.internal_name = "_QPsub11"} {
|
|
%cst = arith.constant 1.100000e+01 : f32
|
|
%c1 = arith.constant 1 : index
|
|
%c1_i32 = arith.constant 1 : i32
|
|
%c0_i32 = arith.constant 0 : i32
|
|
%c6 = arith.constant 6 : index
|
|
%shape = fir.shape %c6 : (index) -> !fir.shape<1>
|
|
%0 = fir.array_coor %arg1(%shape) %c1 : (!fir.ref<!fir.array<6xi32>>, !fir.shape<1>, index) -> !fir.ref<i32>
|
|
fir.store %c0_i32 to %0 : !fir.ref<i32>
|
|
%1 = fir.load %0 : !fir.ref<i32>
|
|
%2 = fir.convert %1 : (i32) -> f32
|
|
%3 = arith.cmpf une, %2, %cst fastmath<contract> : f32
|
|
fir.if %3 {
|
|
%4 = fir.load %0 : !fir.ref<i32>
|
|
%5 = arith.addi %4, %c1_i32 : i32
|
|
fir.store %5 to %0 : !fir.ref<i32>
|
|
}
|
|
return
|
|
}
|