mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-24 04:26:07 +00:00

TOSA MLIR profile-based validation is designed to identify the profile/extension requirements for each operation in TOSA MLIR graph, ensuring that TOSA operators conform to the profiles and extensions enabled by the target implementation. The available profiles/extensions are reflected in the availability property attached to each TOSA operator in the dialect. The design of availability, the profile/extension classes, and their interface, is inspired by the SPIRV implementation. This patch includes the following changes: - Introduces profile and extension knowledge within the dialect and establishes an interface to query this information. - Implements profile-based validation logic in the pass. - Adds a TargetEnv class that represents the capabilities enabled in the target implementation, such as profiles, extensions, and levels. - Adds a set of tests to ensure that profile and extension requirements are properly attached to the operations and that validation correctly verifies the requirements of a given operation against the target implementation.