<commit_before># Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# bazel_to_cmake: DO NOT EDIT (Special logic is used throughout this file)

add_subdirectory(android)
add_subdirectory(test)
add_subdirectory(utils)

# Enable compiler targets based on options.
set(IREE_COMPILER_TARGETS "")
set(IREE_COMPILER_TARGET_COPTS "")
if(${IREE_TARGET_BACKEND_DYLIB-LLVM-AOT})
  list(APPEND IREE_COMPILER_TARGETS iree::compiler::Dialect::HAL::Target::LLVM)
  list(APPEND IREE_COMPILER_TARGET_COPTS "-DIREE_HAVE_LLVMAOT_TARGET")
endif()
if(${IREE_TARGET_BACKEND_METAL-SPIRV})
  list(APPEND IREE_COMPILER_TARGETS iree::compiler::Dialect::HAL::Target::MetalSPIRV)
  list(APPEND IREE_COMPILER_TARGET_COPTS "-DIREE_HAVE_METALSPIRV_TARGET")
endif()
if(${IREE_TARGET_BACKEND_VMLA})
  list(APPEND IREE_COMPILER_TARGETS iree::compiler::Dialect::HAL::Target::VMLA)
  list(APPEND IREE_COMPILER_TARGET_COPTS "-DIREE_HAVE_VMLA_TARGET")
endif()
if(${IREE_TARGET_BACKEND_VULKAN-SPIRV})
  list(APPEND IREE_COMPILER_TARGETS iree::compiler::Dialect::HAL::Target::VulkanSPIRV)
  list(APPEND IREE_COMPILER_TARGET_COPTS "-DIREE_HAVE_VULKANSPIRV_TARGET")
endif()

if(IREE_ENABLE_EMITC)
  set(IREE_OPT_CONDITIONAL_DEPS
    MLIREmitC
  )
  set(IREE_TRANSLATE_CONDITIONAL_DEPS
    MLIREmitC
    MLIRTargetCpp
  )
  set(IREE_EMITC_INCLUDES
    "${PROJECT_SOURCE_DIR}/third_party/mlir-emitc/include"
  )
endif()

iree_cc_binary(
  NAME
    iree-benchmark-module
  OUT
    iree-benchmark-module
  SRCS
    "iree-benchmark-module-main.cc"
  DEPS
    absl::flags
    absl::flags_parse
    absl::flags_usage
    absl::strings
    benchmark
    iree::base::flags
    iree::base::file_io
    iree::base::status
    iree::base::tracing
    iree::hal::drivers
    iree::modules::hal
    iree::tools::utils::vm_util
    iree::vm
    iree::vm::bytecode_module
  TESTONLY
)

iree_cc_binary(
  NAME
    iree-dump-module
  OUT
    iree-dump-module
  SRCS
    "iree-dump-module-main.cc"
  DEPS
    flatcc::runtime
    iree::base::file_mapping
    iree::schemas::bytecode_module_def_c_fbs
)

iree_cc_binary(
  NAME
    iree-run-module
  OUT
    iree-run-module
  SRCS
    "iree-run-module-main.cc"
  DEPS
    absl::flags
    absl::strings
    iree::base::file_io
    iree::base::flags
    iree::base::status
    iree::base::tracing
    iree::hal::drivers
    iree::modules::hal
    iree::tools::utils::vm_util
    iree::vm
    iree::vm::bytecode_module
)

if(${IREE_ENABLE_MLIR})
  iree_cc_binary(
    NAME
      iree-tblgen
    SRCS
      "${IREE_ROOT_DIR}/third_party/llvm-project/mlir/tools/mlir-tblgen/mlir-tblgen.cpp"
      "${IREE_SOURCE_DIR}/iree/compiler/Dialect/IREE/Tools/StructAttrGen.cpp"
      "${IREE_SOURCE_DIR}/iree/compiler/Dialect/VM/Tools/VMOpEncoderGen.cpp"
      "${IREE_SOURCE_DIR}/iree/compiler/Dialect/VM/Tools/VMOpTableGen.cpp"
    DEPS
      LLVMSupport
      LLVMTableGen
      MLIRSupport
      MLIRTableGen
    HOSTONLY
  )
endif()

if(${IREE_BUILD_COMPILER})
  iree_cc_library(
    NAME
      init_iree_passes_and_dialects
    HDRS
      "init_iree_dialects.h"
      "init_iree_passes.h"
    DEPS
      MLIRIR
      iree::compiler::Dialect::Flow::Analysis
      iree::compiler::Dialect::Flow::IR
      iree::compiler::Dialect::Flow::Transforms
      iree::compiler::Dialect::HAL::IR::HALDialect
      iree::compiler::Dialect::HAL::Transforms
      iree::compiler::Dialect::IREE::IR
      iree::compiler::Dialect::IREE::Transforms
      iree::compiler::Dialect::Sequence::IR
      iree::compiler::Dialect::Shape::Conversion
      iree::compiler::Dialect::Shape::IR
      iree::compiler::Dialect::Shape::Transforms
      iree::compiler::Dialect::VM::Analysis
      iree::compiler::Dialect::VM::IR
      iree::compiler::Dialect::VM::Transforms
      iree::compiler::Dialect::VMLA::IR::VMLADialect
      iree::compiler::Dialect::VMLA::Transforms
      iree::compiler::Dialect::Vulkan::IR
      iree::compiler::Translation::IREEVM
    PUBLIC
  )

  iree_cc_library(
    NAME
      init_mlir_passes_and_dialects
    HDRS
      "init_mlir_dialects.h"
      "init_mlir_passes.h"
    DEPS
      MLIRAffine
      MLIRAffineTransforms
      MLIRGPU
      MLIRGPUToSPIRV
      MLIRIR
      MLIRLLVMIR
      MLIRLinalg
      MLIRLinalgToLLVM
      MLIRLinalgToSPIRVTransforms
      MLIRLinalgTransforms
      MLIRQuant
      MLIRSCF
      MLIRSCFToGPU
      MLIRSCFTransforms
      MLIRSDBM
      MLIRSPIRV
      MLIRSPIRVTransforms
      MLIRShape
      MLIRStandard
      MLIRStandardToSPIRV
      MLIRTransforms
      MLIRVector
    PUBLIC
  )

  iree_cc_library(
    NAME
      init_passes_and_dialects
    HDRS
      "init_dialects.h"
      "init_passes.h"
    DEPS
      ::init_compiler_modules
      ::init_iree_passes_and_dialects
      ::init_mlir_passes_and_dialects
      ::init_xla_dialects
      iree::compiler::Conversion::init_conversions
      iree::compiler::Conversion::HLOToLinalg
      iree::compiler::Dialect::HAL::Conversion::Passes
    INCLUDES<commit_msg>Fix MLIRLinalgToSPIRVTransforms -> MLIRLinalgToSPIRV target naming.<commit_after># Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# bazel_to_cmake: DO NOT EDIT (Special logic is used throughout this file)

add_subdirectory(android)
add_subdirectory(test)
add_subdirectory(utils)

# Enable compiler targets based on options.
set(IREE_COMPILER_TARGETS "")
set(IREE_COMPILER_TARGET_COPTS "")
if(${IREE_TARGET_BACKEND_DYLIB-LLVM-AOT})
  list(APPEND IREE_COMPILER_TARGETS iree::compiler::Dialect::HAL::Target::LLVM)
  list(APPEND IREE_COMPILER_TARGET_COPTS "-DIREE_HAVE_LLVMAOT_TARGET")
endif()
if(${IREE_TARGET_BACKEND_METAL-SPIRV})
  list(APPEND IREE_COMPILER_TARGETS iree::compiler::Dialect::HAL::Target::MetalSPIRV)
  list(APPEND IREE_COMPILER_TARGET_COPTS "-DIREE_HAVE_METALSPIRV_TARGET")
endif()
if(${IREE_TARGET_BACKEND_VMLA})
  list(APPEND IREE_COMPILER_TARGETS iree::compiler::Dialect::HAL::Target::VMLA)
  list(APPEND IREE_COMPILER_TARGET_COPTS "-DIREE_HAVE_VMLA_TARGET")
endif()
if(${IREE_TARGET_BACKEND_VULKAN-SPIRV})
  list(APPEND IREE_COMPILER_TARGETS iree::compiler::Dialect::HAL::Target::VulkanSPIRV)
  list(APPEND IREE_COMPILER_TARGET_COPTS "-DIREE_HAVE_VULKANSPIRV_TARGET")
endif()

if(IREE_ENABLE_EMITC)
  set(IREE_OPT_CONDITIONAL_DEPS
    MLIREmitC
  )
  set(IREE_TRANSLATE_CONDITIONAL_DEPS
    MLIREmitC
    MLIRTargetCpp
  )
  set(IREE_EMITC_INCLUDES
    "${PROJECT_SOURCE_DIR}/third_party/mlir-emitc/include"
  )
endif()

iree_cc_binary(
  NAME
    iree-benchmark-module
  OUT
    iree-benchmark-module
  SRCS
    "iree-benchmark-module-main.cc"
  DEPS
    absl::flags
    absl::flags_parse
    absl::flags_usage
    absl::strings
    benchmark
    iree::base::flags
    iree::base::file_io
    iree::base::status
    iree::base::tracing
    iree::hal::drivers
    iree::modules::hal
    iree::tools::utils::vm_util
    iree::vm
    iree::vm::bytecode_module
  TESTONLY
)

iree_cc_binary(
  NAME
    iree-dump-module
  OUT
    iree-dump-module
  SRCS
    "iree-dump-module-main.cc"
  DEPS
    flatcc::runtime
    iree::base::file_mapping
    iree::schemas::bytecode_module_def_c_fbs
)

iree_cc_binary(
  NAME
    iree-run-module
  OUT
    iree-run-module
  SRCS
    "iree-run-module-main.cc"
  DEPS
    absl::flags
    absl::strings
    iree::base::file_io
    iree::base::flags
    iree::base::status
    iree::base::tracing
    iree::hal::drivers
    iree::modules::hal
    iree::tools::utils::vm_util
    iree::vm
    iree::vm::bytecode_module
)

if(${IREE_ENABLE_MLIR})
  iree_cc_binary(
    NAME
      iree-tblgen
    SRCS
      "${IREE_ROOT_DIR}/third_party/llvm-project/mlir/tools/mlir-tblgen/mlir-tblgen.cpp"
      "${IREE_SOURCE_DIR}/iree/compiler/Dialect/IREE/Tools/StructAttrGen.cpp"
      "${IREE_SOURCE_DIR}/iree/compiler/Dialect/VM/Tools/VMOpEncoderGen.cpp"
      "${IREE_SOURCE_DIR}/iree/compiler/Dialect/VM/Tools/VMOpTableGen.cpp"
    DEPS
      LLVMSupport
      LLVMTableGen
      MLIRSupport
      MLIRTableGen
    HOSTONLY
  )
endif()

if(${IREE_BUILD_COMPILER})
  iree_cc_library(
    NAME
      init_iree_passes_and_dialects
    HDRS
      "init_iree_dialects.h"
      "init_iree_passes.h"
    DEPS
      MLIRIR
      iree::compiler::Dialect::Flow::Analysis
      iree::compiler::Dialect::Flow::IR
      iree::compiler::Dialect::Flow::Transforms
      iree::compiler::Dialect::HAL::IR::HALDialect
      iree::compiler::Dialect::HAL::Transforms
      iree::compiler::Dialect::IREE::IR
      iree::compiler::Dialect::IREE::Transforms
      iree::compiler::Dialect::Sequence::IR
      iree::compiler::Dialect::Shape::Conversion
      iree::compiler::Dialect::Shape::IR
      iree::compiler::Dialect::Shape::Transforms
      iree::compiler::Dialect::VM::Analysis
      iree::compiler::Dialect::VM::IR
      iree::compiler::Dialect::VM::Transforms
      iree::compiler::Dialect::VMLA::IR::VMLADialect
      iree::compiler::Dialect::VMLA::Transforms
      iree::compiler::Dialect::Vulkan::IR
      iree::compiler::Translation::IREEVM
    PUBLIC
  )

  iree_cc_library(
    NAME
      init_mlir_passes_and_dialects
    HDRS
      "init_mlir_dialects.h"
      "init_mlir_passes.h"
    DEPS
      MLIRAffine
      MLIRAffineTransforms
      MLIRGPU
      MLIRGPUToSPIRV
      MLIRIR
      MLIRLLVMIR
      MLIRLinalg
      MLIRLinalgToLLVM
      MLIRLinalgToSPIRV
      MLIRLinalgTransforms
      MLIRQuant
      MLIRSCF
      MLIRSCFToGPU
      MLIRSCFTransforms
      MLIRSDBM
      MLIRSPIRV
      MLIRSPIRVTransforms
      MLIRShape
      MLIRStandard
      MLIRStandardToSPIRV
      MLIRTransforms
      MLIRVector
    PUBLIC
  )

  iree_cc_library(
    NAME
      init_passes_and_dialects
    HDRS
      "init_dialects.h"
      "init_passes.h"
    DEPS
      ::init_compiler_modules
      ::init_iree_passes_and_dialects
      ::init_mlir_passes_and_dialects
      ::init_xla_dialects
      iree::compiler::Conversion::init_conversions
      iree::compiler::Conversion::HLOToLinalg
      iree::compiler::Dialect::HAL::Conversion::Passes
    INCLUDES
{'fraction_non_alphanumeric': 0.10478878368536053, 'fraction_numerical': 0.0014566642388929353, 'mean_word_length': 3.943744374437444, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5903275', 'n_tokens_mistral': 4203, 'n_tokens_neox': 4141, 'n_words': 579}