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
68 lines
2.9 KiB
Plaintext
68 lines
2.9 KiB
Plaintext
// RUN: fir-opt --constant-argument-globalisation-opt < %s | FileCheck %s
|
|
// RUN: %flang_fc1 -emit-llvm -O2 -o - %s | FileCheck --check-prefix=DISABLE %s
|
|
module {
|
|
func.func @sub1(%arg0: !fir.ref<i32> {fir.bindc_name = "x"}, %arg1: !fir.ref<i32> {fir.bindc_name = "y"}) {
|
|
%0 = fir.alloca i32 {adapt.valuebyref}
|
|
%1 = fir.alloca f64 {adapt.valuebyref}
|
|
%2 = fir.alloca f64 {adapt.valuebyref}
|
|
%c1_i32 = arith.constant 1 : i32
|
|
%cst = arith.constant 1.000000e+00 : f64
|
|
%cst_0 = arith.constant 0.000000e+00 : f64
|
|
%3 = fir.declare %arg0 {uniq_name = "_QFsub1Ex"} : (!fir.ref<i32>) -> !fir.ref<i32>
|
|
%4 = fir.declare %arg1 {uniq_name = "_QFsub1Ey"} : (!fir.ref<i32>) -> !fir.ref<i32>
|
|
fir.store %cst_0 to %2 : !fir.ref<f64>
|
|
%false = arith.constant false
|
|
fir.store %cst to %1 : !fir.ref<f64>
|
|
%false_1 = arith.constant false
|
|
fir.store %c1_i32 to %0 : !fir.ref<i32>
|
|
%false_2 = arith.constant false
|
|
fir.call @sub2(%2, %1, %3, %4, %0) fastmath<contract> : (!fir.ref<f64>, !fir.ref<f64>, !fir.ref<i32>, !fir.ref<i32>, !fir.ref<i32>) -> ()
|
|
return
|
|
}
|
|
func.func private @sub2(!fir.ref<f64>, !fir.ref<f64>, !fir.ref<i32>, !fir.ref<i32>, !fir.ref<i32>)
|
|
|
|
// CHECK-LABEL: func.func @sub1(
|
|
// CHECK-SAME: [[ARG0:%.*]]: !fir.ref<i32> {{{.*}}},
|
|
// CHECK-SAME: [[ARG1:%.*]]: !fir.ref<i32> {{{.*}}}) {
|
|
// CHECK: [[X:%.*]] = fir.declare [[ARG0]] {{.*}}
|
|
// CHECK: [[Y:%.*]] = fir.declare [[ARG1]] {{.*}}
|
|
// CHECK: [[CONST_R0:%.*]] = fir.address_of([[EXTR_0:@.*]]) : !fir.ref<f64>
|
|
// CHECK: [[CONST_R1:%.*]] = fir.address_of([[EXTR_1:@.*]]) : !fir.ref<f64>
|
|
// CHECK: [[CONST_I:%.*]] = fir.address_of([[EXTR_2:@.*]]) : !fir.ref<i32>
|
|
// CHECK: fir.call @sub2([[CONST_R0]], [[CONST_R1]], [[X]], [[Y]], [[CONST_I]])
|
|
// CHECK-SAME: fastmath<contract>
|
|
// CHECK: return
|
|
|
|
// CHECK: fir.global internal [[EXTR_0]] constant : f64 {
|
|
// CHECK: %{{.*}} = arith.constant 0.000000e+00 : f64
|
|
// CHECK: fir.has_value %{{.*}} : f64
|
|
// CHECK: }
|
|
// CHECK: fir.global internal [[EXTR_1]] constant : f64 {
|
|
// CHECK: %{{.*}} = arith.constant 1.000000e+00 : f64
|
|
// CHECK: fir.has_value %{{.*}} : f64
|
|
// CHECK: }
|
|
// CHECK: fir.global internal [[EXTR_2]] constant : i32 {
|
|
// CHECK: %{{.*}} = arith.constant 1 : i32
|
|
// CHECK: fir.has_value %{{.*}} : i32
|
|
// CHECK: }
|
|
|
|
// DISABLE-LABEL: ; ModuleID =
|
|
// DISABLE-NOT: @_extruded
|
|
// DISABLE: define void @sub1(
|
|
// DISABLE-SAME: ptr {{[^%]*}}[[ARG0:%.*]],
|
|
// DISABLE-SAME: ptr {{[^%]*}}[[ARG1:%.*]])
|
|
// DISABLE-SAME: {
|
|
// DISABLE: [[CONST_R0:%.*]] = alloca double
|
|
// DISABLE: [[CONST_R1:%.*]] = alloca double
|
|
// DISABLE: [[CONST_I:%.*]] = alloca i32
|
|
// DISABLE: store double 0.0{{.*}}+00, ptr [[CONST_R0]]
|
|
// DISABLE: store double 1.0{{.*}}+00, ptr [[CONST_R1]]
|
|
// DISABLE: store i32 1, ptr [[CONST_I]]
|
|
// DISABLE: call void @sub2(ptr nonnull [[CONST_R0]],
|
|
// DISABLE-SAME: ptr nonnull [[CONST_R1]],
|
|
// DISABLE-SAME: ptr [[ARG0]], ptr [[ARG1]],
|
|
// DISABLE-SAME: ptr nonnull [[CONST_I]])
|
|
// DISABLE: ret void
|
|
// DISABLE: }
|
|
}
|