Files
TheRock/compiler/amd-llvm/mlir/test/Analysis/test-cfg-loop-info.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

116 lines
2.4 KiB
MLIR

// RUN: mlir-opt -pass-pipeline="builtin.module(any(test-cfg-loop-info))" --split-input-file %s 2>&1 | FileCheck %s
// CHECK-LABEL: Testing : "no_loop_single_block"
// CHECK: no loops
func.func @no_loop_single_block() {
return
}
// -----
// CHECK-LABEL: Testing : "no_loop"
// CHECK: no loops
func.func @no_loop() {
cf.br ^bb1
^bb1:
return
}
// -----
// CHECK-LABEL: Testing : "simple_loop"
// CHECK-NEXT: Blocks : ^[[BB0:.*]], ^[[BB1:.*]], ^[[BB2:.*]], ^[[BB3:.*]]
// CHECK: Loop at depth 1 containing:
// CHECK-SAME: ^[[BB1]]<header><exiting>
// CHECK-SAME: ^[[BB2]]<latch>
func.func @simple_loop(%c: i1) {
cf.br ^bb1
^bb1:
cf.cond_br %c, ^bb2, ^bb3
^bb2:
cf.br ^bb1
^bb3:
return
}
// -----
// CHECK-LABEL: Testing : "single_block_loop"
// CHECK-NEXT: Blocks : ^[[BB0:.*]], ^[[BB1:.*]], ^[[BB2:.*]]
// CHECK: Loop at depth 1 containing:
// CHECK-SAME: ^[[BB1]]<header><latch><exiting>
func.func @single_block_loop(%c: i1) {
cf.br ^bb1
^bb1:
cf.cond_br %c, ^bb1, ^bb2
^bb2:
return
}
// -----
// CHECK-LABEL: Testing : "nested_loop"
// CHECK-NEXT: Blocks : ^[[BB0:.*]], ^[[BB1:.*]], ^[[BB2:.*]], ^[[BB3:.*]], ^[[BB4:.*]]
// CHECK: Loop at depth 1
// CHECK-SAME: ^[[BB1]]<header><exiting>
// CHECK-SAME: ^[[BB2]]<latch>
// CHECK-SAME: ^[[BB3]]
// CHECK: Loop at depth 2
// CHECK-SAME: ^[[BB2]]<header><exiting>
// CHECK-SAME: ^[[BB3]]<latch>
func.func @nested_loop(%c: i1) {
cf.br ^bb1
^bb1:
cf.cond_br %c, ^bb2, ^bb4
^bb2:
cf.cond_br %c, ^bb1, ^bb3
^bb3:
cf.br ^bb2
^bb4:
return
}
// -----
// CHECK-LABEL: Testing : "multi_latch"
// CHECK-NEXT: Blocks : ^[[BB0:.*]], ^[[BB1:.*]], ^[[BB2:.*]], ^[[BB3:.*]], ^[[BB4:.*]]
// CHECK: Loop at depth 1
// CHECK-SAME: ^[[BB1]]<header><exiting>
// CHECK-SAME: ^[[BB2]]<latch>
// CHECK-SAME: ^[[BB3]]<latch>
func.func @multi_latch(%c: i1) {
cf.br ^bb1
^bb1:
cf.cond_br %c, ^bb4, ^bb2
^bb2:
cf.cond_br %c, ^bb1, ^bb3
^bb3:
cf.br ^bb1
^bb4:
return
}
// -----
// CHECK-LABEL: Testing : "multiple_loops"
// CHECK-NEXT: Blocks : ^[[BB0:.*]], ^[[BB1:.*]], ^[[BB2:.*]], ^[[BB3:.*]], ^[[BB4:.*]], ^[[BB5:.*]]
// CHECK: Loop at depth 1
// CHECK-SAME: ^[[BB3]]<header><exiting>
// CHECK-SAME: ^[[BB4]]<latch>
// CHECK: Loop at depth 1
// CHECK-SAME: ^[[BB1]]<header>
// CHECK-SAME: ^[[BB2]]<latch><exiting>
func.func @multiple_loops(%c: i1) {
cf.br ^bb1
^bb1:
cf.br ^bb2
^bb2:
cf.cond_br %c, ^bb3, ^bb1
^bb3:
cf.cond_br %c, ^bb5, ^bb4
^bb4:
cf.br ^bb3
^bb5:
return
}