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
150 lines
5.1 KiB
MLIR
150 lines
5.1 KiB
MLIR
// RUN: mlir-opt --test-data-layout-query --split-input-file --verify-diagnostics %s | FileCheck %s
|
|
|
|
module attributes { dlti.dl_spec = #dlti.dl_spec<
|
|
#dlti.dl_entry<!ptr.ptr<#test.const_memory_space>, #ptr.spec<size = 32, abi = 32, preferred = 64>>,
|
|
#dlti.dl_entry<!ptr.ptr<#test.const_memory_space<5>>,#ptr.spec<size = 64, abi = 64, preferred = 64>>,
|
|
#dlti.dl_entry<!ptr.ptr<#test.const_memory_space<4>>, #ptr.spec<size = 32, abi = 64, preferred = 64, index = 24>>,
|
|
#dlti.dl_entry<"dlti.default_memory_space", #test.const_memory_space<7>>,
|
|
#dlti.dl_entry<"dlti.alloca_memory_space", #test.const_memory_space<5>>,
|
|
#dlti.dl_entry<"dlti.global_memory_space", #test.const_memory_space<2>>,
|
|
#dlti.dl_entry<"dlti.program_memory_space", #test.const_memory_space<3>>,
|
|
#dlti.dl_entry<"dlti.stack_alignment", 128 : i64>
|
|
>} {
|
|
// CHECK-LABEL: @spec
|
|
func.func @spec() {
|
|
// CHECK: alignment = 4
|
|
// CHECK: alloca_memory_space = #test.const_memory_space<5>
|
|
// CHECK: bitsize = 32
|
|
// CHECK: default_memory_space = #test.const_memory_space<7>
|
|
// CHECK: global_memory_space = #test.const_memory_space<2>
|
|
// CHECK: index = 32
|
|
// CHECK: preferred = 8
|
|
// CHECK: program_memory_space = #test.const_memory_space<3>
|
|
// CHECK: size = 4
|
|
// CHECK: stack_alignment = 128
|
|
"test.data_layout_query"() : () -> !ptr.ptr<#test.const_memory_space>
|
|
// CHECK: alignment = 1
|
|
// CHECK: alloca_memory_space = #test.const_memory_space<5>
|
|
// CHECK: bitsize = 64
|
|
// CHECK: default_memory_space = #test.const_memory_space<7>
|
|
// CHECK: global_memory_space = #test.const_memory_space<2>
|
|
// CHECK: index = 64
|
|
// CHECK: preferred = 1
|
|
// CHECK: program_memory_space = #test.const_memory_space<3>
|
|
// CHECK: size = 8
|
|
// CHECK: stack_alignment = 128
|
|
"test.data_layout_query"() : () -> !ptr.ptr<#test.const_memory_space<3>>
|
|
// CHECK: alignment = 8
|
|
// CHECK: alloca_memory_space = #test.const_memory_space<5>
|
|
// CHECK: bitsize = 64
|
|
// CHECK: default_memory_space = #test.const_memory_space<7>
|
|
// CHECK: global_memory_space = #test.const_memory_space<2>
|
|
// CHECK: index = 64
|
|
// CHECK: preferred = 8
|
|
// CHECK: program_memory_space = #test.const_memory_space<3>
|
|
// CHECK: size = 8
|
|
// CHECK: stack_alignment = 128
|
|
"test.data_layout_query"() : () -> !ptr.ptr<#test.const_memory_space<5>>
|
|
// CHECK: alignment = 8
|
|
// CHECK: alloca_memory_space = #test.const_memory_space<5>
|
|
// CHECK: bitsize = 32
|
|
// CHECK: default_memory_space = #test.const_memory_space<7>
|
|
// CHECK: global_memory_space = #test.const_memory_space<2>
|
|
// CHECK: index = 24
|
|
// CHECK: preferred = 8
|
|
// CHECK: program_memory_space = #test.const_memory_space<3>
|
|
// CHECK: size = 4
|
|
// CHECK: stack_alignment = 128
|
|
"test.data_layout_query"() : () -> !ptr.ptr<#test.const_memory_space<4>>
|
|
return
|
|
}
|
|
}
|
|
|
|
// -----
|
|
|
|
module attributes { dlti.dl_spec = #dlti.dl_spec<
|
|
#dlti.dl_entry<!ptr.ptr<#test.const_memory_space>, #ptr.spec<size = 32, abi = 32, preferred = 32>>,
|
|
#dlti.dl_entry<"dlti.default_memory_space", #test.const_memory_space>
|
|
>} {
|
|
// CHECK-LABEL: @default_memory_space
|
|
func.func @default_memory_space() {
|
|
// CHECK: alignment = 4
|
|
// CHECK: bitsize = 32
|
|
// CHECK: index = 32
|
|
// CHECK: preferred = 4
|
|
// CHECK: size = 4
|
|
"test.data_layout_query"() : () -> !ptr.ptr<#test.const_memory_space>
|
|
// CHECK: alignment = 4
|
|
// CHECK: bitsize = 32
|
|
// CHECK: index = 32
|
|
// CHECK: preferred = 4
|
|
// CHECK: size = 4
|
|
"test.data_layout_query"() : () -> !ptr.ptr<#test.const_memory_space<1>>
|
|
// CHECK: alignment = 4
|
|
// CHECK: bitsize = 32
|
|
// CHECK: index = 32
|
|
// CHECK: preferred = 4
|
|
// CHECK: size = 4
|
|
"test.data_layout_query"() : () -> !ptr.ptr<#test.const_memory_space<2>>
|
|
return
|
|
}
|
|
}
|
|
|
|
// -----
|
|
|
|
// expected-error@+2 {{preferred alignment is expected to be at least as large as ABI alignment}}
|
|
module attributes { dlti.dl_spec = #dlti.dl_spec<
|
|
#dlti.dl_entry<!ptr.ptr<#test.const_memory_space>, #ptr.spec<size = 64, abi = 64, preferred = 32>>
|
|
>} {
|
|
func.func @pointer() {
|
|
return
|
|
}
|
|
}
|
|
|
|
// -----
|
|
|
|
// expected-error@+2 {{size entry must be divisible by 8}}
|
|
module attributes { dlti.dl_spec = #dlti.dl_spec<
|
|
#dlti.dl_entry<!ptr.ptr<#test.const_memory_space>, #ptr.spec<size = 33, abi = 32, preferred = 32>>
|
|
>} {
|
|
func.func @pointer() {
|
|
return
|
|
}
|
|
}
|
|
|
|
|
|
// -----
|
|
|
|
// expected-error@+2 {{abi entry must be divisible by 8}}
|
|
module attributes { dlti.dl_spec = #dlti.dl_spec<
|
|
#dlti.dl_entry<!ptr.ptr<#test.const_memory_space>, #ptr.spec<size = 32, abi = 33, preferred = 64>>
|
|
>} {
|
|
func.func @pointer() {
|
|
return
|
|
}
|
|
}
|
|
|
|
|
|
// -----
|
|
|
|
// expected-error@+2 {{preferred entry must be divisible by 8}}
|
|
module attributes { dlti.dl_spec = #dlti.dl_spec<
|
|
#dlti.dl_entry<!ptr.ptr<#test.const_memory_space>, #ptr.spec<size = 32, abi = 32, preferred = 33>>
|
|
>} {
|
|
func.func @pointer() {
|
|
return
|
|
}
|
|
}
|
|
|
|
|
|
// -----
|
|
|
|
// expected-error@+2 {{index entry must be divisible by 8}}
|
|
module attributes { dlti.dl_spec = #dlti.dl_spec<
|
|
#dlti.dl_entry<!ptr.ptr<#test.const_memory_space>, #ptr.spec<size = 32, abi = 32, preferred = 32, index = 33>>
|
|
>} {
|
|
func.func @pointer() {
|
|
return
|
|
}
|
|
}
|