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
52 lines
1.4 KiB
MLIR
52 lines
1.4 KiB
MLIR
// RUN: mlir-opt -pass-pipeline='builtin.module(func.func(affine-loop-fusion))' %s | FileCheck %s
|
|
|
|
// Test fusion of affine nests in the presence of other region-holding ops
|
|
// (scf.for in the test case below) in the block.
|
|
|
|
// CHECK-LABEL: func @scf_and_affine
|
|
func.func @scf_and_affine(%A : memref<10xf32>) {
|
|
%c0 = arith.constant 0 : index
|
|
%c1 = arith.constant 1 : index
|
|
%c10 = arith.constant 10 : index
|
|
%cst = arith.constant 0.0 : f32
|
|
|
|
%B = memref.alloc() : memref<10xf32>
|
|
%C = memref.alloc() : memref<10xf32>
|
|
|
|
affine.for %j = 0 to 10 {
|
|
%v = affine.load %A[%j] : memref<10xf32>
|
|
affine.store %v, %B[%j] : memref<10xf32>
|
|
}
|
|
|
|
affine.for %j = 0 to 10 {
|
|
%v = affine.load %B[%j] : memref<10xf32>
|
|
affine.store %v, %C[%j] : memref<10xf32>
|
|
}
|
|
// Nests are fused.
|
|
// CHECK: affine.for %{{.*}} = 0 to 10
|
|
// CHECK-NOT: affine.for
|
|
// CHECK: scf.for
|
|
|
|
scf.for %i = %c0 to %c10 step %c1 {
|
|
memref.store %cst, %B[%i] : memref<10xf32>
|
|
}
|
|
|
|
// The nests below shouldn't be fused.
|
|
affine.for %j = 0 to 10 {
|
|
%v = affine.load %A[%j] : memref<10xf32>
|
|
affine.store %v, %B[%j] : memref<10xf32>
|
|
}
|
|
scf.for %i = %c0 to %c10 step %c1 {
|
|
memref.store %cst, %B[%i] : memref<10xf32>
|
|
}
|
|
affine.for %j = 0 to 10 {
|
|
%v = affine.load %B[%j] : memref<10xf32>
|
|
affine.store %v, %C[%j] : memref<10xf32>
|
|
}
|
|
// CHECK: affine.for
|
|
// CHECK: scf.for
|
|
// CHECK: affine.for
|
|
|
|
return
|
|
}
|