brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.1 KiB · 361c8be Raw
82 lines · plain
1// RUN: mlir-opt %s | mlir-opt | FileCheck %s2 3// Round-tripping the syntax.4 5// CHECK: #[[MAP:.*]] = affine_map<(d0) -> (d0)>6 7"test.unknown_op"() {8  // CHECK: #dlti.dl_entry<"test.identifier", 42 : i64>9  test.unknown_attr_1 = #dlti.dl_entry<"test.identifier", 42 : i64>,10  // CHECK: #dlti.dl_entry<"test.identifier", #[[MAP]]>11  test.unknown_attr_2 = #dlti.dl_entry<"test.identifier", affine_map<(d0) -> (d0)>>,12  // CHECK: #dlti.dl_entry<i32, 32 : index>13  test.unknown_attr_3 = #dlti.dl_entry<i32, 32 : index>,14  // CHECK: #dlti.dl_entry<memref<?x?xf32>, ["string", 10]>15  test.unknown_attr_4 = #dlti.dl_entry<memref<?x?xf32>, ["string", 10]>,16  // CHECK: #dlti.dl_spec<>17  test.unknown_attr_5 = #dlti.dl_spec<>,18  // CHECK: #dlti.dl_spec<"test.id" = 42 : i32>19  test.unknown_attr_6 = #dlti.dl_spec<"test.id" = 42 : i32>,20  // CHECK: #dlti.dl_spec<21  // CHECK:   "test.id1" = 43 : index,22  // CHECK:   "test.id2" = 44 : index,23  // CHECK:   "test.id3" = 45 : index>24  test.unknown_attr_7 = #dlti.dl_spec<25    "test.id1" = 43 : index,26    "test.id2" = 44 : index,27    "test.id3" = 45 : index>,28  // CHECK: #dlti.dl_spec<29  // CHECK:   "test.id1" = 43 : index,30  // CHECK:   "test.id2" = 44 : index,31  // CHECK:   "test.id3" = 45 : index>32  test.unknown_attr_7_unsugared = #dlti.dl_spec<33    #dlti.dl_entry<"test.id1", 43 : index>,34    #dlti.dl_entry<"test.id2", 44 : index>,35    #dlti.dl_entry<"test.id3", 45 : index>>36} : () -> ()37 38//39// Supported cases where we shouldn't fail. No need to file-check these, not40// triggering an error or an assertion is enough.41//42 43// Should not fail on missing spec.44"test.op_with_data_layout"() : () -> ()45 46// Should not fail on empty spec.47"test.op_with_data_layout"() { dlti.dl_spec = #dlti.dl_spec<> }: () -> ()48 49// Should not fail on nested compatible layouts.50"test.op_with_data_layout"() ({51  "test.op_with_data_layout"() { dlti.dl_spec = #dlti.dl_spec<"unknown.unknown" = 32> } : () -> ()52  "test.maybe_terminator_op"() : () -> ()53}) { dlti.dl_spec = #dlti.dl_spec<"unknown.unknown" = 32> } : () -> ()54 55// Should not fail on deeper nested compatible layouts.56"test.op_with_data_layout"() ({57  "test.op_with_data_layout"() ({58    "test.op_with_data_layout"()59       { dlti.dl_spec = #dlti.dl_spec<"unknown.unknown" = 32> } : () -> ()60    "test.maybe_terminator_op"() : () -> ()61  }) { dlti.dl_spec = #dlti.dl_spec<"unknown.unknown" = 32> } : () -> ()62  "test.maybe_terminator_op"() : () -> ()63}) { dlti.dl_spec = #dlti.dl_spec<"unknown.unknown" = 32> } : () -> ()64 65// A valid target system description66// CHECK: module attributes {67// CHECK:   dlti.target_system_spec = #dlti.target_system_spec<68// CHECK:     "CPU" = #dlti.target_device_spec<69// CHECK:       "dlti.L1_cache_size_in_bytes" = 4096 : ui32>,70// CHECK:    "GPU" = #dlti.target_device_spec<71// CHECK:       "dlti.max_vector_op_width" = 128 : ui32>72// CHECK:   >} {73// CHECK: }74module attributes {75  dlti.target_system_spec = #dlti.target_system_spec<76    "CPU" = #dlti.target_device_spec<77      "dlti.L1_cache_size_in_bytes" = 4096 : ui32>,78    "GPU" = #dlti.target_device_spec<79      "dlti.max_vector_op_width" = 128 : ui32>80  >} {}81 82