llvm-project
16ad97ee - [mlir][tosa] Add the concept of a TOSA target environment (#153771)

Commit
22 hours ago
[mlir][tosa] Add the concept of a TOSA target environment (#153771) This commit introduces a new module-level attribute `tosa.target_env`. It encapsulates target information for use during compilation such as: level, profiles and extensions. For example: ```mlir module attributes {tosa.target_env = #tosa.target_env<level = none, profiles = [pro_int], extensions = [int16, int4]>} { <my-tosa-program> } ``` Previously the validation pass accepted target information as a series of command line pass options. This commit changes the behaviour to query the attached target environment from the module attribute. This refactoring allows other passes to query the same target information. A new target environment can be attached using the `--tosa-attach-target` pass, which takes the same command line options as the previous validation pass arguments. For example: ```bash mlir-opt --tosa-attach-target="profiles=pro_int extensions=int4,int16 level=none" test.mlir ```
Author
Parents
Loading