<commit_before>include(AddMLIRPython)

declare_mlir_python_sources(MLIRHLOPythonSources)
declare_mlir_python_sources(MLIRHLOPythonExtensions)

################################################################################
# Generate dialect-specific bindings.
################################################################################

declare_mlir_python_sources(MLIRHLOPythonSources.Dialects
  ADD_TO_PARENT MLIRHLOPythonSources
)

declare_mlir_dialect_python_bindings(
  ADD_TO_PARENT MLIRHLOPythonSources.Dialects
  ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/mlir"
  TD_FILE dialects/MhloOps.td
  SOURCES dialects/mhlo.py
  DIALECT_NAME mhlo)

 declare_mlir_dialect_python_bindings(
  ADD_TO_PARENT MLIRHLOPythonSources.Dialects
  ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/mlir"
  TD_FILE dialects/ChloOps.td
  SOURCES dialects/chlo.py
  DIALECT_NAME chlo)

################################################################################
# Extensions
################################################################################

declare_mlir_python_extension(MLIRHLOPythonExtensions.Main
  MODULE_NAME _mlirHlo
  ADD_TO_PARENT MLIRHLOPythonExtensions
  SOURCES
    ${CMAKE_CURRENT_SOURCE_DIR}/MlirHloModule.cpp
  EMBED_CAPI_LINK_LIBS
    MLIRHLOCAPIDialects
  PRIVATE_LINK_LIBS
    LLVMSupport
)

################################################################################
# Generate packages and shared library<commit_msg>Remove `${CMAKE_CURRENT_SOURCE_DIR}/` from `declare_mlir_python_extension`.<commit_after>include(AddMLIRPython)

declare_mlir_python_sources(MLIRHLOPythonSources)
declare_mlir_python_sources(MLIRHLOPythonExtensions)

################################################################################
# Generate dialect-specific bindings.
################################################################################

declare_mlir_python_sources(MLIRHLOPythonSources.Dialects
  ADD_TO_PARENT MLIRHLOPythonSources
)

declare_mlir_dialect_python_bindings(
  ADD_TO_PARENT MLIRHLOPythonSources.Dialects
  ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/mlir"
  TD_FILE dialects/MhloOps.td
  SOURCES dialects/mhlo.py
  DIALECT_NAME mhlo)

 declare_mlir_dialect_python_bindings(
  ADD_TO_PARENT MLIRHLOPythonSources.Dialects
  ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/mlir"
  TD_FILE dialects/ChloOps.td
  SOURCES dialects/chlo.py
  DIALECT_NAME chlo)

################################################################################
# Extensions
################################################################################

declare_mlir_python_extension(MLIRHLOPythonExtensions.Main
  MODULE_NAME _mlirHlo
  ADD_TO_PARENT MLIRHLOPythonExtensions
  SOURCES
    MlirHloModule.cpp
  EMBED_CAPI_LINK_LIBS
    MLIRHLOCAPIDialects
  PRIVATE_LINK_LIBS
    LLVMSupport
)

################################################################################
# Generate packages and shared library
{'fraction_non_alphanumeric': 0.31211286992429454, 'fraction_numerical': 0.0, 'mean_word_length': 10.137931034482758, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '3395538', 'n_tokens_mistral': 926, 'n_tokens_neox': 853, 'n_words': 98}