Skip to content

Instantly share code, notes, and snippets.

@pashu123
Created October 1, 2024 16:47
Show Gist options
  • Save pashu123/443c373d85c1ba794edd6647dbf61b82 to your computer and use it in GitHub Desktop.
Save pashu123/443c373d85c1ba794edd6647dbf61b82 to your computer and use it in GitHub Desktop.
concat.mlir:0:0: error: failed to legalize operation 'util.initializer' that was explicitly marked illegal
concat.mlir:0:0: note: see current operation:
"util.initializer"() <{function_type = () -> ()}> ({
%0 = "arith.constant"() <{value = 1 : i8}> : () -> i8
%1 = "arith.constant"() <{value = 0 : i8}> : () -> i8
%2 = "arith.constant"() <{value = 8 : index}> : () -> index
%3 = "arith.constant"() <{value = 1 : i32}> : () -> i32
%4 = "arith.constant"() <{value = -1 : i64}> : () -> i64
%5 = "util.null"() : () -> !hal.executable
%6 = "arith.constant"() <{value = 14 : i32}> : () -> i32
%7 = "arith.constant"() <{value = -1 : index}> : () -> index
%8 = "arith.constant"() <{value = 5 : i32}> : () -> i32
%9 = "arith.constant"() <{value = false}> : () -> i1
%10 = "arith.constant"() <{value = 0 : index}> : () -> index
%11 = "arith.constant"() <{value = 1 : index}> : () -> index
%12 = "util.null"() : () -> !hal.device
%13 = "hal.devices.count"() : () -> index
"cf.br"(%10, %10, %12)[^bb1] : (index, index, !hal.device) -> ()
^bb1(%14: index, %15: index, %16: !hal.device): // 2 preds: ^bb0, ^bb4
%17 = "util.cmp.eq"(%16, %12) : (!hal.device, !hal.device) -> i1
%18 = "arith.cmpi"(%14, %13) <{predicate = 2 : i64}> : (index, index) -> i1
%19 = "arith.andi"(%17, %18) : (i1, i1) -> i1
"cf.cond_br"(%19)[^bb2, ^bb5] <{operandSegmentSizes = array<i32: 1, 0, 0>}> : (i1) -> ()
^bb2: // pred: ^bb1
%20 = "hal.devices.get"(%14) : (index) -> !hal.device
%21:2 = "hal.device.query"(%20) {category = "hal.device.id", default_value = false, key = "local*"} : (!hal.device) -> (i1, i1)
"cf.cond_br"(%21#1, %9)[^bb3, ^bb4] <{operandSegmentSizes = array<i32: 1, 0, 1>}> : (i1, i1) -> ()
^bb3: // pred: ^bb2
%22:2 = "hal.device.query"(%20) {category = "hal.executable.format", default_value = false, key = "embedded-elf-x86_64"} : (!hal.device) -> (i1, i1)
"cf.br"(%22#1)[^bb4] : (i1) -> ()
^bb4(%23: i1): // 2 preds: ^bb2, ^bb3
%24 = "arith.cmpi"(%15, %10) <{predicate = 0 : i64}> : (index, index) -> i1
%25 = "arith.select"(%23, %11, %10) : (i1, index, index) -> index
%26 = "arith.addi"(%15, %25) <{overflowFlags = #arith.overflow<none>}> : (index, index) -> index
%27 = "arith.andi"(%23, %24) : (i1, i1) -> i1
%28 = "arith.select"(%27, %20, %12) : (i1, !hal.device, !hal.device) -> !hal.device
%29 = "arith.addi"(%14, %11) <{overflowFlags = #arith.overflow<none>}> : (index, index) -> index
"cf.br"(%29, %26, %28)[^bb1] : (index, index, !hal.device) -> ()
^bb5: // pred: ^bb1
"cf.cond_br"(%17)[^bb6, ^bb7] <{operandSegmentSizes = array<i32: 1, 0, 0>}> : (i1) -> ()
^bb6: // pred: ^bb5
"util.status.check_ok"(%8) <{message = "HAL device `__device_0` not found or unavailable: #hal.device.target<\22local\22, [#hal.executable.target<\22llvm-cpu\22, \22embedded-elf-x86_64\22, {cpu = \22generic\22, cpu_features = \22\22, data_layout = \22e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128\22, native_vector_size = 16 : i64, target_triple = \22x86_64-unknown-unknown-eabi-elf\22}>]>"}> : (i32) -> ()
"cf.br"()[^bb7] : () -> ()
^bb7: // 2 preds: ^bb5, ^bb6
%30:2 = "hal.device.query"(%16) {category = "hal.executable.format", default_value = false, key = "embedded-elf-x86_64"} : (!hal.device) -> (i1, i1)
%31 = "arith.select"(%30#1, %10, %7) : (i1, index, index) -> index
%32 = "arith.cmpi"(%31, %10) <{predicate = 0 : i64}> : (index, index) -> i1
"util.global.store"(%16) <{global = @__device_0}> : (!hal.device) -> ()
"cf.cond_br"(%32)[^bb8, ^bb9] <{operandSegmentSizes = array<i32: 1, 0, 0>}> : (i1) -> ()
^bb8: // pred: ^bb7
%33 = "hal.executable.create"(%16) {executable_target = @concat_linked_llvm_cpu::@embedded_elf_x86_64} : (!hal.device) -> !hal.executable
"cf.br"(%33)[^bb10] : (!hal.executable) -> ()
^bb9: // pred: ^bb7
"util.status.check_ok"(%6) <{message = "HAL device `__device_0` does not support any variant of executable `concat_linked_llvm_cpu`; available formats: [embedded-elf-x86_64]"}> : (i32) -> ()
"cf.br"(%5)[^bb10] : (!hal.executable) -> ()
^bb10(%34: !hal.executable): // 2 preds: ^bb8, ^bb9
%35 = "util.global.load"() <{global = @__device_0, is_immutable}> : () -> !hal.device
%36 = "hal.command_buffer.create"(%35, %4, %11) {command_categories = 3 : i32, modes = 0 : i32} : (!hal.device, i64, index) -> !hal.command_buffer
%37:3 = "flow.dispatch.workgroup_count_from_dag_root"(%11) : (index) -> (index, index, index)
"hal.command_buffer.dispatch"(%36, %34, %10, %37#0, %37#1, %37#2, %3, %10, %10, %2) {flags = 0 : i64, operandSegmentSizes = array<i32: 1, 1, 1, 1, 1, 1, 1, 1, 1, 1>} : (!hal.command_buffer, !hal.executable, index, index, index, index, i32, index, index, index) -> ()
"hal.command_buffer.execution_barrier"(%36) {flags = 0 : i32, source_stage_mask = 28 : i32, target_stage_mask = 13 : i32} : (!hal.command_buffer) -> ()
"hal.command_buffer.finalize"(%36) : (!hal.command_buffer) -> ()
%38 = "hal.command_buffer.create"(%35, %4, %11) {command_categories = 3 : i32, modes = 0 : i32} : (!hal.device, i64, index) -> !hal.command_buffer
"hal.command_buffer.dispatch"(%38, %34, %10, %37#0, %37#1, %37#2, %8, %10, %10, %2) {flags = 0 : i64, operandSegmentSizes = array<i32: 1, 1, 1, 1, 1, 1, 1, 1, 1, 1>} : (!hal.command_buffer, !hal.executable, index, index, index, index, i32, index, index, index) -> ()
"hal.command_buffer.execution_barrier"(%38) {flags = 0 : i32, source_stage_mask = 28 : i32, target_stage_mask = 13 : i32} : (!hal.command_buffer) -> ()
"hal.command_buffer.finalize"(%38) : (!hal.command_buffer) -> ()
%39 = "hal.command_buffer.create"(%35, %4, %11) {command_categories = 1 : i32, modes = 0 : i32} : (!hal.device, i64, index) -> !hal.command_buffer
"hal.command_buffer.fill_buffer"(%39, %10, %10, %11, %1) : (!hal.command_buffer, index, index, index, i8) -> ()
"hal.command_buffer.execution_barrier"(%39) {flags = 0 : i32, source_stage_mask = 28 : i32, target_stage_mask = 13 : i32} : (!hal.command_buffer) -> ()
"hal.command_buffer.finalize"(%39) : (!hal.command_buffer) -> ()
%40 = "hal.command_buffer.create"(%35, %4, %11) {command_categories = 1 : i32, modes = 0 : i32} : (!hal.device, i64, index) -> !hal.command_buffer
"hal.command_buffer.fill_buffer"(%40, %10, %10, %11, %0) : (!hal.command_buffer, index, index, index, i8) -> ()
"hal.command_buffer.execution_barrier"(%40) {flags = 0 : i32, source_stage_mask = 28 : i32, target_stage_mask = 13 : i32} : (!hal.command_buffer) -> ()
"hal.command_buffer.finalize"(%40) : (!hal.command_buffer) -> ()
"util.global.store"(%36) <{global = @___compare_i64_memoize_result_0_device_0}> : (!hal.command_buffer) -> ()
"util.global.store"(%38) <{global = @___compare_i64_memoize_result_0_device_0_1}> : (!hal.command_buffer) -> ()
"util.global.store"(%39) <{global = @___compare_i64_memoize_result_0_device_0_4}> : (!hal.command_buffer) -> ()
"util.global.store"(%40) <{global = @___compare_i64_memoize_result_0_device_0_7}> : (!hal.command_buffer) -> ()
"util.global.store"(%34) <{global = @__device_0_executable_0_concat_linked_llvm_cpu}> : (!hal.executable) -> ()
"util.return"() : () -> ()
}) : () -> ()
concat.mlir:0:0: error: conversion to vm.module failed
concat.mlir:0:0: note: see current operation:
"builtin.module"() ({
"builtin.module"() ({
"hal.executable"() ({
"hal.executable.binary"() {data = dense_resource<__elided__> : vector<4168xi8>, format = "embedded-elf-x86_64", mime_type = "application/x-elf", sym_name = "embedded_elf_x86_64"} : () -> ()
"hal.executable_end"() : () -> ()
}) {sym_name = "concat_linked_llvm_cpu", sym_visibility = "private"} : () -> ()
"util.global"() <{sym_name = "__device_0", sym_visibility = "private", type = !hal.device}> : () -> ()
"util.initializer"() <{function_type = () -> ()}> ({
%46 = "arith.constant"() <{value = 1 : i8}> : () -> i8
%47 = "arith.constant"() <{value = 0 : i8}> : () -> i8
%48 = "arith.constant"() <{value = 8 : index}> : () -> index
%49 = "arith.constant"() <{value = 1 : i32}> : () -> i32
%50 = "arith.constant"() <{value = -1 : i64}> : () -> i64
%51 = "util.null"() : () -> !hal.executable
%52 = "arith.constant"() <{value = 14 : i32}> : () -> i32
%53 = "arith.constant"() <{value = -1 : index}> : () -> index
%54 = "arith.constant"() <{value = 5 : i32}> : () -> i32
%55 = "arith.constant"() <{value = false}> : () -> i1
%56 = "arith.constant"() <{value = 0 : index}> : () -> index
%57 = "arith.constant"() <{value = 1 : index}> : () -> index
%58 = "util.null"() : () -> !hal.device
%59 = "hal.devices.count"() : () -> index
"cf.br"(%56, %56, %58)[^bb1] : (index, index, !hal.device) -> ()
^bb1(%60: index, %61: index, %62: !hal.device): // 2 preds: ^bb0, ^bb4
%63 = "util.cmp.eq"(%62, %58) : (!hal.device, !hal.device) -> i1
%64 = "arith.cmpi"(%60, %59) <{predicate = 2 : i64}> : (index, index) -> i1
%65 = "arith.andi"(%63, %64) : (i1, i1) -> i1
"cf.cond_br"(%65)[^bb2, ^bb5] <{operandSegmentSizes = array<i32: 1, 0, 0>}> : (i1) -> ()
^bb2: // pred: ^bb1
%66 = "hal.devices.get"(%60) : (index) -> !hal.device
%67:2 = "hal.device.query"(%66) {category = "hal.device.id", default_value = false, key = "local*"} : (!hal.device) -> (i1, i1)
"cf.cond_br"(%67#1, %55)[^bb3, ^bb4] <{operandSegmentSizes = array<i32: 1, 0, 1>}> : (i1, i1) -> ()
^bb3: // pred: ^bb2
%68:2 = "hal.device.query"(%66) {category = "hal.executable.format", default_value = false, key = "embedded-elf-x86_64"} : (!hal.device) -> (i1, i1)
"cf.br"(%68#1)[^bb4] : (i1) -> ()
^bb4(%69: i1): // 2 preds: ^bb2, ^bb3
%70 = "arith.cmpi"(%61, %56) <{predicate = 0 : i64}> : (index, index) -> i1
%71 = "arith.select"(%69, %57, %56) : (i1, index, index) -> index
%72 = "arith.addi"(%61, %71) <{overflowFlags = #arith.overflow<none>}> : (index, index) -> index
%73 = "arith.andi"(%69, %70) : (i1, i1) -> i1
%74 = "arith.select"(%73, %66, %58) : (i1, !hal.device, !hal.device) -> !hal.device
%75 = "arith.addi"(%60, %57) <{overflowFlags = #arith.overflow<none>}> : (index, index) -> index
"cf.br"(%75, %72, %74)[^bb1] : (index, index, !hal.device) -> ()
^bb5: // pred: ^bb1
"cf.cond_br"(%63)[^bb6, ^bb7] <{operandSegmentSizes = array<i32: 1, 0, 0>}> : (i1) -> ()
^bb6: // pred: ^bb5
"util.status.check_ok"(%54) <{message = "HAL device `__device_0` not found or unavailable: #hal.device.target<\22local\22, [#hal.executable.target<\22llvm-cpu\22, \22embedded-elf-x86_64\22, {cpu = \22generic\22, cpu_features = \22\22, data_layout = \22e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128\22, native_vector_size = 16 : i64, target_triple = \22x86_64-unknown-unknown-eabi-elf\22}>]>"}> : (i32) -> ()
"cf.br"()[^bb7] : () -> ()
^bb7: // 2 preds: ^bb5, ^bb6
%76:2 = "hal.device.query"(%62) {category = "hal.executable.format", default_value = false, key = "embedded-elf-x86_64"} : (!hal.device) -> (i1, i1)
%77 = "arith.select"(%76#1, %56, %53) : (i1, index, index) -> index
%78 = "arith.cmpi"(%77, %56) <{predicate = 0 : i64}> : (index, index) -> i1
"util.global.store"(%62) <{global = @__device_0}> : (!hal.device) -> ()
"cf.cond_br"(%78)[^bb8, ^bb9] <{operandSegmentSizes = array<i32: 1, 0, 0>}> : (i1) -> ()
^bb8: // pred: ^bb7
%79 = "hal.executable.create"(%62) {executable_target = @concat_linked_llvm_cpu::@embedded_elf_x86_64} : (!hal.device) -> !hal.executable
"cf.br"(%79)[^bb10] : (!hal.executable) -> ()
^bb9: // pred: ^bb7
"util.status.check_ok"(%52) <{message = "HAL device `__device_0` does not support any variant of executable `concat_linked_llvm_cpu`; available formats: [embedded-elf-x86_64]"}> : (i32) -> ()
"cf.br"(%51)[^bb10] : (!hal.executable) -> ()
^bb10(%80: !hal.executable): // 2 preds: ^bb8, ^bb9
%81 = "util.global.load"() <{global = @__device_0, is_immutable}> : () -> !hal.device
%82 = "hal.command_buffer.create"(%81, %50, %57) {command_categories = 3 : i32, modes = 0 : i32} : (!hal.device, i64, index) -> !hal.command_buffer
%83:3 = "flow.dispatch.workgroup_count_from_dag_root"(%57) : (index) -> (index, index, index)
"hal.command_buffer.dispatch"(%82, %80, %56, %83#0, %83#1, %83#2, %49, %56, %56, %48) {flags = 0 : i64, operandSegmentSizes = array<i32: 1, 1, 1, 1, 1, 1, 1, 1, 1, 1>} : (!hal.command_buffer, !hal.executable, index, index, index, index, i32, index, index, index) -> ()
"hal.command_buffer.execution_barrier"(%82) {flags = 0 : i32, source_stage_mask = 28 : i32, target_stage_mask = 13 : i32} : (!hal.command_buffer) -> ()
"hal.command_buffer.finalize"(%82) : (!hal.command_buffer) -> ()
%84 = "hal.command_buffer.create"(%81, %50, %57) {command_categories = 3 : i32, modes = 0 : i32} : (!hal.device, i64, index) -> !hal.command_buffer
"hal.command_buffer.dispatch"(%84, %80, %56, %83#0, %83#1, %83#2, %54, %56, %56, %48) {flags = 0 : i64, operandSegmentSizes = array<i32: 1, 1, 1, 1, 1, 1, 1, 1, 1, 1>} : (!hal.command_buffer, !hal.executable, index, index, index, index, i32, index, index, index) -> ()
"hal.command_buffer.execution_barrier"(%84) {flags = 0 : i32, source_stage_mask = 28 : i32, target_stage_mask = 13 : i32} : (!hal.command_buffer) -> ()
"hal.command_buffer.finalize"(%84) : (!hal.command_buffer) -> ()
%85 = "hal.command_buffer.create"(%81, %50, %57) {command_categories = 1 : i32, modes = 0 : i32} : (!hal.device, i64, index) -> !hal.command_buffer
"hal.command_buffer.fill_buffer"(%85, %56, %56, %57, %47) : (!hal.command_buffer, index, index, index, i8) -> ()
"hal.command_buffer.execution_barrier"(%85) {flags = 0 : i32, source_stage_mask = 28 : i32, target_stage_mask = 13 : i32} : (!hal.command_buffer) -> ()
"hal.command_buffer.finalize"(%85) : (!hal.command_buffer) -> ()
%86 = "hal.command_buffer.create"(%81, %50, %57) {command_categories = 1 : i32, modes = 0 : i32} : (!hal.device, i64, index) -> !hal.command_buffer
"hal.command_buffer.fill_buffer"(%86, %56, %56, %57, %46) : (!hal.command_buffer, index, index, index, i8) -> ()
"hal.command_buffer.execution_barrier"(%86) {flags = 0 : i32, source_stage_mask = 28 : i32, target_stage_mask = 13 : i32} : (!hal.command_buffer) -> ()
"hal.command_buffer.finalize"(%86) : (!hal.command_buffer) -> ()
"util.global.store"(%82) <{global = @___compare_i64_memoize_result_0_device_0}> : (!hal.command_buffer) -> ()
"util.global.store"(%84) <{global = @___compare_i64_memoize_result_0_device_0_1}> : (!hal.command_buffer) -> ()
"util.global.store"(%85) <{global = @___compare_i64_memoize_result_0_device_0_4}> : (!hal.command_buffer) -> ()
"util.global.store"(%86) <{global = @___compare_i64_memoize_result_0_device_0_7}> : (!hal.command_buffer) -> ()
"util.global.store"(%80) <{global = @__device_0_executable_0_concat_linked_llvm_cpu}> : (!hal.executable) -> ()
"util.return"() : () -> ()
}) : () -> ()
"util.global"() <{sym_name = "__device_0_executable_0_concat_linked_llvm_cpu", sym_visibility = "private", type = !hal.executable}> : () -> ()
"util.func"() <{function_type = () -> (), sym_name = "compare_i64"}> ({
"util.call"() <{callee = @_compare_i64}> : () -> ()
"util.return"() : () -> ()
}) {iree.abi.stub, iree.reflection = {iree.abi.declaration = "sync func @compare_i64() -> ()"}} : () -> ()
"util.global"() <{sym_name = "___compare_i64_memoize_result_0_device_0", sym_visibility = "private", type = !hal.command_buffer}> : () -> ()
"util.global"() <{sym_name = "___compare_i64_memoize_result_0_device_0_1", sym_visibility = "private", type = !hal.command_buffer}> : () -> ()
"util.global"() <{sym_name = "___compare_i64_memoize_result_0_device_0_4", sym_visibility = "private", type = !hal.command_buffer}> : () -> ()
"util.global"() <{sym_name = "___compare_i64_memoize_result_0_device_0_7", sym_visibility = "private", type = !hal.command_buffer}> : () -> ()
"vm.import"() <{arg_attrs = [{vm.name = "operand"}], function_type = (i32) -> (), is_optional, sym_name = "check.expect_true", sym_visibility = "private"}> ({
}) : () -> ()
"vm.import"() <{arg_attrs = [{vm.name = "operand"}], function_type = (i32) -> (), is_optional, sym_name = "check.expect_false", sym_visibility = "private"}> ({
}) : () -> ()
"vm.import"() <{arg_attrs = [{vm.name = "device"}, {vm.name = "operand"}], function_type = (!vm.ref<!hal.device>, !vm.ref<!hal.buffer_view>) -> (), is_optional, sym_name = "check.expect_all_true", sym_visibility = "private"}> ({
}) : () -> ()
"vm.import"() <{arg_attrs = [{vm.name = "device"}, {vm.name = "lhs"}, {vm.name = "rhs"}], function_type = (!vm.ref<!hal.device>, !vm.ref<!hal.buffer_view>, !vm.ref<!hal.buffer_view>) -> (), is_optional, sym_name = "check.expect_eq", sym_visibility = "private"}> ({
}) : () -> ()
"vm.import"() <{arg_attrs = [{vm.name = "device"}, {vm.name = "lhs"}, {vm.name = "rhs"}], function_type = (!vm.ref<!hal.device>, !vm.ref<!hal.buffer_view>, !vm.ref<!hal.buffer_view>) -> (), is_optional, sym_name = "check.expect_almost_eq", sym_visibility = "private"}> ({
}) : () -> ()
"vm.import"() <{arg_attrs = [{vm.name = "device"}, {vm.name = "queue_affinity"}, {vm.name = "access"}, {vm.name = "buffer"}, {vm.name = "offset"}, {vm.name = "length"}, {vm.name = "flags"}], function_type = (!vm.ref<!hal.device>, i64, i32, !vm.buffer, i64, i64, i32) -> !vm.ref<!hal.file>, sym_name = "hal.ex.file.from_memory", sym_visibility = "private"}> ({
}) : () -> ()
"vm.import"() <{arg_attrs = [{vm.name = "allocator"}, {vm.name = "queue_affinity"}, {vm.name = "memory_types"}, {vm.name = "buffer_usage"}, {vm.name = "allocation_size"}], function_type = (!vm.ref<!hal.allocator>, i64, i32, i32, i64) -> !vm.ref<!hal.buffer>, sym_name = "hal.allocator.allocate", sym_visibility = "private"}> ({
}) : () -> ()
"vm.import"() <{arg_attrs = [{vm.name = "allocator"}, {vm.name = "try"}, {vm.name = "queue_affinity"}, {vm.name = "memory_types"}, {vm.name = "buffer_usage"}, {vm.name = "source"}, {vm.name = "offset"}, {vm.name = "length"}], function_type = (!vm.ref<!hal.allocator>, i32, i64, i32, i32, !vm.buffer, i64, i64) -> !vm.ref<!hal.buffer>, sym_name = "hal.allocator.import", sym_visibility = "private"}> ({
}) : () -> ()
"vm.import"() <{arg_attrs = [{vm.name = "buffer"}, {vm.name = "message"}, {vm.name = "allocator"}, {vm.name = "minimum_length"}, {vm.name = "memory_types"}, {vm.name = "buffer_usage"}], function_type = (!vm.ref<!hal.buffer>, !vm.buffer, !vm.ref<!hal.allocator>, i64, i32, i32) -> (), sym_name = "hal.buffer.assert", sym_visibility = "private"}> ({
}) : () -> ()
"vm.import"() <{arg_attrs = [{vm.name = "source_buffer"}, {vm.name = "source_offset"}, {vm.name = "length"}], function_type = (!vm.ref<!hal.buffer>, i64, i64) -> !vm.ref<!hal.buffer>, sym_name = "hal.buffer.subspan", sym_visibility = "private"}> ({
}) {nosideeffects} : () -> ()
"vm.import"() <{arg_attrs = [{vm.name = "buffer"}], function_type = (!vm.ref<!hal.buffer>) -> i64, sym_name = "hal.buffer.length", sym_visibility = "private"}> ({
}) {nosideeffects} : () -> ()
"vm.import"() <{arg_attrs = [{vm.name = "source_buffer"}, {vm.name = "source_offset"}, {vm.name = "length"}], function_type = (!vm.ref<!hal.buffer>, i64, i32) -> i32, sym_name = "hal.buffer.load", sym_visibility = "private"}> ({
}) : () -> ()
"vm.import"() <{arg_attrs = [{vm.name = "value"}, {vm.name = "target_buffer"}, {vm.name = "target_offset"}, {vm.name = "length"}], function_type = (i32, !vm.ref<!hal.buffer>, i64, i32) -> (), sym_name = "hal.buffer.store", sym_visibility = "private"}> ({
}) : () -> ()
"vm.import"() <{arg_attrs = [{vm.name = "buffer"}, {vm.name = "source_offset"}, {vm.name = "source_length"}, {vm.name = "element_type"}, {vm.name = "encoding_type"}, {vm.name = "shape", vm.variadic}], function_type = (!vm.ref<!hal.buffer>, i64, i64, i32, i32, i64) -> !vm.ref<!hal.buffer_view>, sym_name = "hal.buffer_view.create", sym_visibility = "private"}> ({
}) {nosideeffects} : () -> ()
"vm.import"() <{arg_attrs = [{vm.name = "buffer_view"}, {vm.name = "message"}, {vm.name = "element_type"}, {vm.name = "encoding_type"}, {vm.name = "shape", vm.variadic}], function_type = (!vm.ref<!hal.buffer_view>, !vm.buffer, i32, i32, i64) -> (), sym_name = "hal.buffer_view.assert", sym_visibility = "private"}> ({
}) : () -> ()
"vm.import"() <{arg_attrs = [{vm.name = "buffer_view"}], function_type = (!vm.ref<!hal.buffer_view>) -> !vm.ref<!hal.buffer>, sym_name = "hal.buffer_view.buffer", sym_visibility = "private"}> ({
}) {nosideeffects} : () -> ()
"vm.import"() <{arg_attrs = [{vm.name = "buffer_view"}], function_type = (!vm.ref<!hal.buffer_view>) -> i32, sym_name = "hal.buffer_view.element_type", sym_visibility = "private"}> ({
}) {nosideeffects} : () -> ()
"vm.import"() <{arg_attrs = [{vm.name = "buffer_view"}], function_type = (!vm.ref<!hal.buffer_view>) -> i32, sym_name = "hal.buffer_view.encoding_type", sym_visibility = "private"}> ({
}) {nosideeffects} : () -> ()
"vm.import"() <{arg_attrs = [{vm.name = "buffer_view"}], function_type = (!vm.ref<!hal.buffer_view>) -> i32, sym_name = "hal.buffer_view.rank", sym_visibility = "private"}> ({
}) {nosideeffects} : () -> ()
"vm.import"() <{arg_attrs = [{vm.name = "buffer_view"}, {vm.name = "index"}], function_type = (!vm.ref<!hal.buffer_view>, i32) -> i64, sym_name = "hal.buffer_view.dim", sym_visibility = "private"}> ({
}) {nosideeffects} : () -> ()
"vm.import"() <{arg_attrs = [{vm.name = "key"}, {vm.name = "operands", vm.variadic}], function_type = (!vm.buffer, !vm.ref<!hal.buffer_view>) -> (), sym_name = "hal.buffer_view.trace", sym_visibility = "private"}> ({
}) : () -> ()
"vm.import"() <{arg_attrs = [{vm.name = "device"}, {vm.name = "queue_affinity"}, {vm.name = "flags"}, {vm.name = "id"}, {vm.name = "group"}, {vm.name = "rank"}, {vm.name = "count"}], function_type = (!vm.ref<!hal.device>, i64, i32, !vm.buffer, !vm.buffer, i32, i32) -> !vm.ref<!hal.channel>, sym_name = "hal.channel.create", sym_visibility = "private"}> ({
}) {nosideeffects} : () -> ()
"vm.import"() <{arg_attrs = [{vm.name = "channel"}, {vm.name = "color"}, {vm.name = "key"}, {vm.name = "flags"}], function_type = (!vm.ref<!hal.channel>, i32, i32, i32) -> !vm.ref<!hal.channel>, sym_name = "hal.channel.split", sym_visibility = "private"}> ({
}) {nosideeffects} : () -> ()
"vm.import"() <{arg_attrs = [{vm.name = "channel"}], function_type = (!vm.ref<!hal.channel>) -> (i32, i32), sym_name = "hal.channel.rank_and_count", sym_visibility = "private"}> ({
}) {nosideeffects} : () -> ()
"vm.import"() <{arg_attrs = [{vm.name = "device"}, {vm.name = "modes"}, {vm.name = "command_categories"}, {vm.name = "queue_affinity"}, {vm.name = "binding_capacity"}], function_type = (!vm.ref<!hal.device>, i32, i32, i64, i32) -> !vm.ref<!hal.command_buffer>, minimum_version = 5 : i32, sym_name = "hal.command_buffer.create", sym_visibility = "private"}> ({
}) : () -> ()
"vm.import"() <{arg_attrs = [{vm.name = "command_buffer"}], function_type = (!vm.ref<!hal.command_buffer>) -> (), sym_name = "hal.command_buffer.finalize", sym_visibility = "private"}> ({
}) : () -> ()
"vm.import"() <{arg_attrs = [{vm.name = "command_buffer"}, {vm.name = "label"}], function_type = (!vm.ref<!hal.command_buffer>, !vm.buffer) -> (), sym_name = "hal.command_buffer.begin_debug_group", sym_visibility = "private"}> ({
}) : () -> ()
"vm.import"() <{arg_attrs = [{vm.name = "command_buffer"}], function_type = (!vm.ref<!hal.command_buffer>) -> (), sym_name = "hal.command_buffer.end_debug_group", sym_visibility = "private"}> ({
}) : () -> ()
"vm.import"() <{arg_attrs = [{vm.name = "command_buffer"}, {vm.name = "source_stage_mask"}, {vm.name = "target_stage_mask"}, {vm.name = "flags"}], function_type = (!vm.ref<!hal.command_buffer>, i32, i32, i32) -> (), sym_name = "hal.command_buffer.execution_barrier", sym_visibility = "private"}> ({
}) : () -> ()
"vm.import"() <{arg_attrs = [{vm.name = "command_buffer"}, {vm.name = "target_buffer"}, {vm.name = "target_offset"}, {vm.name = "length"}, {vm.name = "target_buffer_slot"}, {vm.name = "pattern"}, {vm.name = "pattern_length"}], function_type = (!vm.ref<!hal.command_buffer>, !vm.ref<!hal.buffer>, i64, i64, i32, i32, i32) -> (), sym_name = "hal.command_buffer.fill_buffer", sym_visibility = "private"}> ({
}) : () -> ()
"vm.import"() <{arg_attrs = [{vm.name = "command_buffer"}, {vm.name = "source_buffer"}, {vm.name = "source_offset"}, {vm.name = "target_buffer"}, {vm.name = "target_offset"}, {vm.name = "length"}, {vm.name = "target_buffer_slot"}], function_type = (!vm.ref<!hal.command_buffer>, !vm.buffer, i64, !vm.ref<!hal.buffer>, i64, i64, i32) -> (), sym_name = "hal.command_buffer.update_buffer", sym_visibility = "private"}> ({
}) : () -> ()
"vm.import"() <{arg_attrs = [{vm.name = "command_buffer"}, {vm.name = "source_buffer_slot"}, {vm.name = "target_buffer_slot"}, {vm.name = "source_buffer"}, {vm.name = "source_offset"}, {vm.name = "target_buffer"}, {vm.name = "target_offset"}, {vm.name = "length"}], function_type = (!vm.ref<!hal.command_buffer>, i32, i32, !vm.ref<!hal.buffer>, i64, !vm.ref<!hal.buffer>, i64, i64) -> (), sym_name = "hal.command_buffer.copy_buffer", sym_visibility = "private"}> ({
}) : () -> ()
"vm.import"() <{arg_attrs = [{vm.name = "command_buffer"}, {vm.name = "channel"}, {vm.name = "op"}, {vm.name = "param"}, {vm.name = "send_buffer_slot"}, {vm.name = "recv_buffer_slot"}, {vm.name = "send_buffer"}, {vm.name = "recv_buffer"}, {vm.name = "send_offset"}, {vm.name = "send_length"}, {vm.name = "recv_offset"}, {vm.name = "recv_length"}, {vm.name = "element_count"}], function_type = (!vm.ref<!hal.command_buffer>, !vm.ref<!hal.channel>, i32, i32, i32, i32, !vm.ref<!hal.buffer>, !vm.ref<!hal.buffer>, i64, i64, i64, i64, i64) -> (), sym_name = "hal.command_buffer.collective", sym_visibility = "private"}> ({
}) : () -> ()
"vm.import"() <{arg_attrs = [{vm.name = "command_buffer"}, {vm.name = "executable"}, {vm.name = "entry_point"}, {vm.name = "workgroup_x"}, {vm.name = "workgroup_y"}, {vm.name = "workgroup_z"}, {vm.name = "flags"}, {vm.name = "constants", vm.variadic}, {vm.name = "bindings", vm.variadic}], function_type = (!vm.ref<!hal.command_buffer>, !vm.ref<!hal.executable>, i32, i32, i32, i32, i64, i32, tuple<i32, i32, !vm.ref<!hal.buffer>, i64, i64>) -> (), sym_name = "hal.command_buffer.dispatch", sym_visibility = "private"}> ({
}) : () -> ()
"vm.import"() <{arg_attrs = [{vm.name = "command_buffer"}, {vm.name = "executable"}, {vm.name = "entry_point"}, {vm.name = "workgroups_buffer_slot"}, {vm.name = "workgroups_buffer"}, {vm.name = "workgroups_offset"}, {vm.name = "flags"}, {vm.name = "constants", vm.variadic}, {vm.name = "bindings", vm.variadic}], function_type = (!vm.ref<!hal.command_buffer>, !vm.ref<!hal.executable>, i32, i32, !vm.ref<!hal.buffer>, i64, i64, i32, tuple<i32, i32, !vm.ref<!hal.buffer>, i64, i64>) -> (), sym_name = "hal.command_buffer.dispatch.indirect", sym_visibility = "private"}> ({
}) : () -> ()
"vm.import"() <{arg_attrs = [{vm.name = "device"}], function_type = (!vm.ref<!hal.device>) -> !vm.ref<!hal.allocator>, sym_name = "hal.device.allocator", sym_visibility = "private"}> ({
}) {nosideeffects} : () -> ()
"vm.import"() <{arg_attrs = [{vm.name = "device"}, {vm.name = "category"}, {vm.name = "key"}], function_type = (!vm.ref<!hal.device>, !vm.buffer, !vm.buffer) -> (i32, i64), sym_name = "hal.device.query.i64", sym_visibility = "private"}> ({
}) {nosideeffects} : () -> ()
"vm.import"() <{arg_attrs = [{vm.name = "device"}, {vm.name = "queue_affinity"}, {vm.name = "wait_fence"}, {vm.name = "signal_fence"}, {vm.name = "pool"}, {vm.name = "memory_types"}, {vm.name = "buffer_usage"}, {vm.name = "allocation_size"}], function_type = (!vm.ref<!hal.device>, i64, !vm.ref<!hal.fence>, !vm.ref<!hal.fence>, i32, i32, i32, i64) -> !vm.ref<!hal.buffer>, sym_name = "hal.device.queue.alloca", sym_visibility = "private"}> ({
}) : () -> ()
"vm.import"() <{arg_attrs = [{vm.name = "device"}, {vm.name = "queue_affinity"}, {vm.name = "wait_fence"}, {vm.name = "signal_fence"}, {vm.name = "buffer"}], function_type = (!vm.ref<!hal.device>, i64, !vm.ref<!hal.fence>, !vm.ref<!hal.fence>, !vm.ref<!hal.buffer>) -> (), sym_name = "hal.device.queue.dealloca", sym_visibility = "private"}> ({
}) : () -> ()
"vm.import"() <{arg_attrs = [{vm.name = "device"}, {vm.name = "queue_affinity"}, {vm.name = "wait_fence"}, {vm.name = "signal_fence"}, {vm.name = "source_file"}, {vm.name = "source_offset"}, {vm.name = "target_buffer"}, {vm.name = "target_offset"}, {vm.name = "length"}, {vm.name = "flags"}], function_type = (!vm.ref<!hal.device>, i64, !vm.ref<!hal.fence>, !vm.ref<!hal.fence>, !vm.ref<!hal.file>, i64, !vm.ref<!hal.buffer>, i64, i64, i32) -> (), sym_name = "hal.device.queue.read", sym_visibility = "private"}> ({
}) : () -> ()
"vm.import"() <{arg_attrs = [{vm.name = "device"}, {vm.name = "queue_affinity"}, {vm.name = "wait_fence"}, {vm.name = "signal_fence"}, {vm.name = "source_buffer"}, {vm.name = "source_offset"}, {vm.name = "target_file"}, {vm.name = "target_offset"}, {vm.name = "length"}, {vm.name = "flags"}], function_type = (!vm.ref<!hal.device>, i64, !vm.ref<!hal.fence>, !vm.ref<!hal.fence>, !vm.ref<!hal.buffer>, i64, !vm.ref<!hal.file>, i64, i64, i32) -> (), sym_name = "hal.device.queue.write", sym_visibility = "private"}> ({
}) : () -> ()
"vm.import"() <{arg_attrs = [{vm.name = "device"}, {vm.name = "queue_affinity"}, {vm.name = "wait_fence"}, {vm.name = "signal_fence"}, {vm.name = "command_buffers", vm.variadic}], function_type = (!vm.ref<!hal.device>, i64, !vm.ref<!hal.fence>, !vm.ref<!hal.fence>, !vm.ref<!hal.command_buffer>) -> (), sym_name = "hal.device.queue.execute", sym_visibility = "private"}> ({
}) : () -> ()
"vm.import"() <{arg_attrs = [{vm.name = "device"}, {vm.name = "queue_affinity"}, {vm.name = "wait_fence"}, {vm.name = "signal_fence"}, {vm.name = "command_buffer"}, {vm.name = "binding_table", vm.variadic}], function_type = (!vm.ref<!hal.device>, i64, !vm.ref<!hal.fence>, !vm.ref<!hal.fence>, !vm.ref<!hal.command_buffer>, tuple<!vm.ref<!hal.buffer>, i64, i64>) -> (), sym_name = "hal.device.queue.execute.indirect", sym_visibility = "private"}> ({
}) : () -> ()
"vm.import"() <{arg_attrs = [{vm.name = "device"}, {vm.name = "queue_affinity"}], function_type = (!vm.ref<!hal.device>, i64) -> (), sym_name = "hal.device.queue.flush", sym_visibility = "private"}> ({
}) : () -> ()
"vm.import"() <{function_type = () -> i32, sym_name = "hal.devices.count", sym_visibility = "private"}> ({
}) {nosideeffects} : () -> ()
"vm.import"() <{arg_attrs = [{vm.name = "index"}], function_type = (i32) -> !vm.ref<!hal.device>, sym_name = "hal.devices.get", sym_visibility = "private"}> ({
}) {nosideeffects} : () -> ()
"vm.import"() <{arg_attrs = [{vm.name = "device"}, {vm.name = "executable_format"}, {vm.name = "executable_data"}, {vm.name = "constants"}], function_type = (!vm.ref<!hal.device>, !vm.buffer, !vm.buffer, !vm.buffer) -> !vm.ref<!hal.executable>, sym_name = "hal.executable.create", sym_visibility = "private"}> ({
}) {nosideeffects} : () -> ()
"vm.import"() <{arg_attrs = [{vm.name = "device"}, {vm.name = "flags"}], function_type = (!vm.ref<!hal.device>, i32) -> !vm.ref<!hal.fence>, sym_name = "hal.fence.create", sym_visibility = "private"}> ({
}) : () -> ()
"vm.import"() <{arg_attrs = [{vm.name = "fences", vm.variadic}], function_type = (!vm.ref<!hal.fence>) -> !vm.ref<!hal.fence>, sym_name = "hal.fence.join", sym_visibility = "private"}> ({
}) {nosideeffects} : () -> ()
"vm.import"() <{arg_attrs = [{vm.name = "fence"}], function_type = (!vm.ref<!hal.fence>) -> i32, sym_name = "hal.fence.query", sym_visibility = "private"}> ({
}) : () -> ()
"vm.import"() <{arg_attrs = [{vm.name = "fence"}], function_type = (!vm.ref<!hal.fence>) -> (), sym_name = "hal.fence.signal", sym_visibility = "private"}> ({
}) : () -> ()
"vm.import"() <{arg_attrs = [{vm.name = "fence"}, {vm.name = "status"}], function_type = (!vm.ref<!hal.fence>, i32) -> (), sym_name = "hal.fence.fail", sym_visibility = "private"}> ({
}) : () -> ()
"vm.import"() <{arg_attrs = [{vm.name = "timeout_millis"}, {vm.name = "fences", vm.variadic}], function_type = (i32, !vm.ref<!hal.fence>) -> i32, sym_name = "hal.fence.await", sym_visibility = "private"}> ({
}) {vm.yield} : () -> ()
"util.func"() <{function_type = () -> (), sym_name = "_compare_i64", sym_visibility = "private"}> ({
%0 = "arith.constant"() <{value = 1 : index}> : () -> index
%1 = "arith.constant"() <{value = 0 : index}> : () -> index
%2 = "arith.constant"() <{value = 8 : index}> : () -> index
%3 = "arith.constant"() <{value = -1 : i64}> : () -> i64
%4 = "util.null"() : () -> !hal.fence
%5 = "arith.constant"() <{value = 0 : i64}> : () -> i64
%6 = "arith.constant"() <{value = -1 : i32}> : () -> i32
%7 = "util.global.load"() <{global = @__device_0, is_immutable}> : () -> !hal.device
%8 = "util.global.load"() <{global = @__device_0_executable_0_concat_linked_llvm_cpu, is_immutable}> : () -> !hal.executable
%9 = "util.global.load"() <{global = @___compare_i64_memoize_result_0_device_0, is_immutable}> : () -> !hal.command_buffer
%10 = "util.global.load"() <{global = @___compare_i64_memoize_result_0_device_0_1, is_immutable}> : () -> !hal.command_buffer
%11 = "util.global.load"() <{global = @___compare_i64_memoize_result_0_device_0_4, is_immutable}> : () -> !hal.command_buffer
%12 = "util.global.load"() <{global = @___compare_i64_memoize_result_0_device_0_7, is_immutable}> : () -> !hal.command_buffer
%13 = "hal.fence.create"(%7) {flags = 0 : i32} : (!hal.device) -> !hal.fence
%14 = "hal.device.queue.alloca"(%7, %3, %4, %13, %5, %2) {buffer_usage = 3075 : i32, memory_types = 48 : i32} : (!hal.device, i64, !hal.fence, !hal.fence, i64, index) -> !hal.buffer
%15 = "hal.fence.create"(%7) {flags = 0 : i32} : (!hal.device) -> !hal.fence
"hal.device.queue.execute.indirect"(%7, %3, %13, %15, %9, %14, %1, %2) : (!hal.device, i64, !hal.fence, !hal.fence, !hal.command_buffer, !hal.buffer, index, index) -> ()
%16 = "hal.fence.await"(%6, %15) : (i32, !hal.fence) -> i32
"util.status.check_ok"(%16) <{message = "failed to wait on timepoint"}> : (i32) -> ()
%17 = "util.optimization_barrier"(%14) : (!hal.buffer) -> !hal.buffer
%18 = "hal.fence.create"(%7) {flags = 0 : i32} : (!hal.device) -> !hal.fence
%19 = "hal.device.queue.alloca"(%7, %3, %4, %18, %5, %2) {buffer_usage = 3075 : i32, memory_types = 48 : i32} : (!hal.device, i64, !hal.fence, !hal.fence, i64, index) -> !hal.buffer
%20 = "hal.fence.create"(%7) {flags = 0 : i32} : (!hal.device) -> !hal.fence
"hal.device.queue.execute.indirect"(%7, %3, %18, %20, %10, %19, %1, %2) : (!hal.device, i64, !hal.fence, !hal.fence, !hal.command_buffer, !hal.buffer, index, index) -> ()
%21 = "hal.fence.await"(%6, %20) : (i32, !hal.fence) -> i32
"util.status.check_ok"(%21) <{message = "failed to wait on timepoint"}> : (i32) -> ()
%22 = "util.optimization_barrier"(%19) : (!hal.buffer) -> !hal.buffer
%23 = "hal.fence.create"(%7) {flags = 0 : i32} : (!hal.device) -> !hal.fence
%24 = "hal.device.queue.alloca"(%7, %3, %4, %23, %5, %0) {buffer_usage = 3075 : i32, memory_types = 48 : i32} : (!hal.device, i64, !hal.fence, !hal.fence, i64, index) -> !hal.buffer
%25 = "hal.fence.create"(%7) {flags = 0 : i32} : (!hal.device) -> !hal.fence
"hal.device.queue.execute.indirect"(%7, %3, %23, %25, %11, %24, %1, %0) : (!hal.device, i64, !hal.fence, !hal.fence, !hal.command_buffer, !hal.buffer, index, index) -> ()
%26 = "hal.fence.await"(%6, %25) : (i32, !hal.fence) -> i32
"util.status.check_ok"(%26) <{message = "failed to wait on timepoint"}> : (i32) -> ()
%27 = "util.optimization_barrier"(%24) : (!hal.buffer) -> !hal.buffer
%28 = "hal.fence.create"(%7) {flags = 0 : i32} : (!hal.device) -> !hal.fence
%29 = "hal.device.queue.alloca"(%7, %3, %4, %28, %5, %0) {buffer_usage = 3075 : i32, memory_types = 48 : i32} : (!hal.device, i64, !hal.fence, !hal.fence, i64, index) -> !hal.buffer
%30 = "hal.fence.create"(%7) {flags = 0 : i32} : (!hal.device) -> !hal.fence
"hal.device.queue.execute.indirect"(%7, %3, %28, %30, %12, %29, %1, %0) : (!hal.device, i64, !hal.fence, !hal.fence, !hal.command_buffer, !hal.buffer, index, index) -> ()
%31 = "hal.fence.await"(%6, %30) : (i32, !hal.fence) -> i32
"util.status.check_ok"(%31) <{message = "failed to wait on timepoint"}> : (i32) -> ()
%32 = "util.optimization_barrier"(%29) : (!hal.buffer) -> !hal.buffer
%33 = "hal.buffer.length"(%17) : (!hal.buffer) -> index
%34 = "hal.buffer.length"(%22) : (!hal.buffer) -> index
%35 = "hal.buffer.length"(%32) : (!hal.buffer) -> index
%36 = "hal.buffer.length"(%27) : (!hal.buffer) -> index
%37 = "hal.fence.create"(%7) {flags = 0 : i32} : (!hal.device) -> !hal.fence
%38 = "hal.device.queue.alloca"(%7, %3, %4, %37, %5, %0) {buffer_usage = 3075 : i32, memory_types = 48 : i32} : (!hal.device, i64, !hal.fence, !hal.fence, i64, index) -> !hal.buffer
%39 = "hal.command_buffer.create"(%7, %3) {command_categories = 3 : i32, modes = 1 : i32} : (!hal.device, i64) -> !hal.command_buffer
"hal.command_buffer.dispatch"(%39, %8, %0, %0, %0, %0, %17, %22, %32, %27, %38, %1, %1, %1, %1, %1, %33, %34, %35, %36, %0) {flags = 0 : i64, operandSegmentSizes = array<i32: 1, 1, 1, 1, 1, 1, 0, 5, 5, 5>} : (!hal.command_buffer, !hal.executable, index, index, index, index, !hal.buffer, !hal.buffer, !hal.buffer, !hal.buffer, !hal.buffer, index, index, index, index, index, index, index, index, index, index) -> ()
"hal.command_buffer.execution_barrier"(%39) {flags = 0 : i32, source_stage_mask = 28 : i32, target_stage_mask = 13 : i32} : (!hal.command_buffer) -> ()
"hal.command_buffer.finalize"(%39) : (!hal.command_buffer) -> ()
%40 = "hal.fence.create"(%7) {flags = 0 : i32} : (!hal.device) -> !hal.fence
"hal.device.queue.execute"(%7, %3, %37, %40, %39) : (!hal.device, i64, !hal.fence, !hal.fence, !hal.command_buffer) -> ()
%41 = "hal.fence.await"(%6, %40) : (i32, !hal.fence) -> i32
"util.status.check_ok"(%41) <{message = "failed to wait on timepoint"}> : (i32) -> ()
%42 = "hal.encoding_type"() : () -> i32
%43 = "hal.element_type"() {type = i8} : () -> i32
%44 = "hal.buffer_view.create"(%38, %1, %0, %43, %42) : (!hal.buffer, index, index, i32, i32) -> !hal.buffer_view
%45 = "hal.buffer_view.create"(%24, %1, %0, %43, %42) : (!hal.buffer, index, index, i32, i32) -> !hal.buffer_view
"check.expect_eq"(%7, %44, %45) : (!hal.device, !hal.buffer_view, !hal.buffer_view) -> ()
"util.return"() : () -> ()
}) : () -> ()
}) : () -> ()
}) {vm.toplevel} : () -> ()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment