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
42 lines
1.6 KiB
Plaintext
42 lines
1.6 KiB
Plaintext
// RUN: fir-opt --bufferize-hlfir %s | FileCheck %s
|
|
|
|
func.func @shape_of_non_dominating_block(%cond: i1, %n: index) {
|
|
%shape = fir.shape %n : (index) -> !fir.shape<1>
|
|
%expr = hlfir.elemental %shape : (!fir.shape<1>) -> !hlfir.expr<?xi32> {
|
|
^bb0(%i: index):
|
|
%c0 = arith.constant 0 : i32
|
|
hlfir.yield_element %c0 : i32
|
|
}
|
|
%assoc:3 = hlfir.associate %expr(%shape) {uniq_name = "test"} : (!hlfir.expr<?xi32>, !fir.shape<1>) -> (!fir.box<!fir.array<?xi32>>, !fir.ref<!fir.array<?xi32>>, i1)
|
|
cf.cond_br %cond, ^bb1, ^bb2
|
|
^bb1:
|
|
%s = hlfir.shape_of %expr : (!hlfir.expr<?xi32>) -> !fir.shape<1>
|
|
cf.br ^bb3
|
|
^bb2:
|
|
cf.br ^bb3
|
|
^bb3:
|
|
hlfir.end_associate %assoc#1, %assoc#2 : !fir.ref<!fir.array<?xi32>>, i1
|
|
hlfir.destroy %expr : !hlfir.expr<?xi32>
|
|
return
|
|
}
|
|
|
|
// The shape_of in ^bb1 does not dominate the end_associate in ^bb3
|
|
// (^bb3 is reachable from ^bb2 as well), so allOtherUsesAreSafeForAssociate
|
|
// returns false and the associate takes the copy path.
|
|
// CHECK-LABEL: func.func @shape_of_non_dominating_block(
|
|
// CHECK-SAME: %[[COND:.*]]: i1, %[[N:.*]]: index)
|
|
// CHECK: %[[SHAPE:.*]] = fir.shape %[[N]]
|
|
// CHECK: %[[ELEM_BUF:.*]] = fir.allocmem !fir.array<?xi32>, %[[N]] {{.*}}".tmp.array"
|
|
// CHECK: fir.do_loop
|
|
// CHECK: %[[COPY_BUF:.*]] = fir.allocmem !fir.array<?xi32>, %[[N]] {{.*}}".tmp"
|
|
// CHECK: hlfir.assign %{{.*}} to %{{.*}} temporary_lhs
|
|
// CHECK: cf.cond_br %[[COND]], ^bb1, ^bb2
|
|
// CHECK: ^bb1:
|
|
// CHECK: cf.br ^bb3
|
|
// CHECK: ^bb2:
|
|
// CHECK: cf.br ^bb3
|
|
// CHECK: ^bb3:
|
|
// CHECK: fir.freemem
|
|
// CHECK: fir.freemem
|
|
// CHECK: return
|