Files
TheRock/compiler/amd-llvm/mlir/test/Target/LLVMIR/openmp-barrier-cancel.mlir
T
derek.holloway 7502bf64a4
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
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

53 lines
2.7 KiB
MLIR

// RUN: mlir-translate --mlir-to-llvmir %s | FileCheck %s
// Regression test for a compiler crash. Ensure that the insertion point is set
// correctly after the barrier's cancel check
llvm.func @test() {
omp.parallel {
omp.cancel cancellation_construct_type(parallel)
omp.barrier
omp.terminator
}
llvm.return
}
// CHECK-LABEL: define internal void @test..omp_par
// CHECK: omp.par.entry:
// CHECK: %[[VAL_4:.*]] = alloca i32, align 4
// CHECK: %[[VAL_5:.*]] = load i32, ptr %[[VAL_6:.*]], align 4
// CHECK: store i32 %[[VAL_5]], ptr %[[VAL_4]], align 4
// CHECK: %[[VAL_7:.*]] = load i32, ptr %[[VAL_4]], align 4
// CHECK: br label %[[VAL_8:.*]]
// CHECK: omp.region.after_alloca: ; preds = %[[VAL_9:.*]]
// CHECK: br label %[[VAL_10:.*]]
// CHECK: omp.par.region: ; preds = %[[VAL_8]]
// CHECK: br label %[[VAL_11:.*]]
// CHECK: omp.par.region1: ; preds = %[[VAL_10]]
// CHECK: %[[VAL_12:.*]] = call i32 @__kmpc_global_thread_num(ptr @1)
// CHECK: %[[VAL_13:.*]] = call i32 @__kmpc_cancel(ptr @1, i32 %[[VAL_12]], i32 1)
// CHECK: %[[VAL_14:.*]] = icmp eq i32 %[[VAL_13]], 0
// CHECK: br i1 %[[VAL_14]], label %[[VAL_15:.*]], label %[[VAL_16:.*]]
// CHECK: omp.par.region1.cncl: ; preds = %[[VAL_11]]
// CHECK: br label %[[FINI:.*]]
// CHECK: .fini:
// CHECK: %[[TID:.*]] = call i32 @__kmpc_global_thread_num(ptr @1)
// CHECK: %[[CNCL_BARRIER:.*]] = call i32 @__kmpc_cancel_barrier(ptr @2, i32 %[[TID]])
// CHECK: br label %[[EXIT_STUB:.*]]
// CHECK: omp.par.region1.split: ; preds = %[[VAL_11]]
// CHECK: %[[VAL_20:.*]] = call i32 @__kmpc_global_thread_num(ptr @1)
// CHECK: %[[VAL_21:.*]] = call i32 @__kmpc_cancel_barrier(ptr @3, i32 %[[VAL_20]])
// CHECK: %[[VAL_22:.*]] = icmp eq i32 %[[VAL_21]], 0
// CHECK: br i1 %[[VAL_22]], label %[[VAL_23:.*]], label %[[VAL_24:.*]]
// CHECK: omp.par.region1.split.cncl: ; preds = %[[VAL_15]]
// CHECK: br label %[[FINI]]
// CHECK: omp.par.region1.split.cont: ; preds = %[[VAL_15]]
// CHECK: br label %[[VAL_25:.*]]
// CHECK: omp.region.cont: ; preds = %[[VAL_23]]
// CHECK: br label %[[VAL_26:.*]]
// CHECK: omp.par.pre_finalize: ; preds = %[[VAL_25]]
// CHECK: br label %[[FINI]]
// CHECK: omp.par.exit.exitStub:
// CHECK: ret void