| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
[mlir][emitc] Add div, mul and rem operators This adds operations for binary multiplicative arithmetic operators to EmitC. The input and output arguments for the remainder operator are restricted to index (emitted as size_t), integers and the EmitC opaque types (as the operator can be overloaded for a custom type). The multiplication and division operator further support floating point numbers. Reviewed By: jpienaar Differential Revision: https://reviews.llvm.org/D154846 | 3 年前 | |
[mlir][emitc] Rename call op to call_opaque (#72494) This renames the emitc.call op to emitc.call_opaque as the existing call op does not refer to the callee by symbol. The rename allows to introduce a new call op alongside with a future emitc.func op to model and facilitate functions and function calls. | 2 年前 | |
[mlir][EmitC] Add bitwise operators (#83387) This adds operations for bitwise operators. Furthermore, an UnaryOp class and a helper to print unary operations are introduced. | 2 年前 | |
[mlir][emitc] Arith to EmitC conversion: constants (#83798) * Add a conversion from arith.constant to emitc.constant. * Drop the translation for arith.constants. | 2 年前 | |
[mlir][emitc] Add a cast op This adds a cast operation that allows to perform an explicit type conversion. The cast op is emitted as a C-style cast. It can be applied to integer, float, index and EmitC types. Reviewed By: jpienaar Differential Revision: https://reviews.llvm.org/D123514 | 4 年前 | |
[mlir][emitc] Clean up EmitC tests (#152327) Changes: - Unnecessary -verify-diagnostics flags were removed from tests. - mlir/test/mlir-translate/emitc_classops.mlir was moved to mlir/test/Target/Cpp/class.mlir. - The transfrom.mlir test was renamed to form-expressions.mlir for clarity. - Test for emitc.class, emitc.field and emitc.get_field was added to mlir/test/Dialect/EmitC/ops.mlir. - wrap_emitc_func_in_class.mlir and wrap_emitc_func_in_class_noAttr.mlir were combined into wrap-func-in-class.mlir. | 1 年前 | |
Fix handling of integer template argument in emitc.call_opaque (#141451) Integer attributes supplied to emitc.call_opaque as arguments were treated as index into the operands list. This should be the case only for the normal arguments but not for the template arguments which can't refer to SSA values. This commit updates the handling of template arguments in mlir-to-cpp by removing special handling of integer attributes. | 1 年前 | |
[mlir][emitc] Add comparison operation This adds a comparison operation to EmitC which supports ==, !=, <=, <, >=, >, <=>. Reviewed By: jpienaar Differential Revision: https://reviews.llvm.org/D158180 | 2 年前 | |
[mlir][EmitC] Add an emitc.conditional operator (#84883) This adds an emitc.conditional operation for the ternary conditional operator. Furthermore, this adds a converion from arith.select to the new op. | 2 年前 | |
[mlir][emitc] Support dense as init value for ShapedType (#144826) | 11 个月前 | |
[mlir][emitc] Isolate expressions from above (#155641) The expression op is currently not isolated from above. This served its original usage as an optional, translation-oriented op, but is becoming less convenient now that expressions appear earlier in the emitc compilation flow and are gaining use as components of other emitc ops. This patch therefore adds the isolated-from-above trait to expressions. Syntactically, the only change is in the expression's signature which now includes the values being used in the expression as arguments and their types. The region's argument's names shadow the used values to keep the def-use relations clear. | 11 个月前 | |
[MLIR][Target/Cpp] Fix variable naming conflict for function declarations (#147927) This is a fix for https://github.com/llvm/llvm-project/pull/136102. It missed scoping for DeclareFuncOps. In scenarios with multiple function declarations, the valueMapper wasn't updated and later uses of values in other functions still used the assigned names in prior functions. This is visible in the reproducer here https://github.com/iree-org/iree/issues/21303: Although the counter for variable enumeration was reset, as it is visible for the local vars, the function arguments were mapped to old names. Due to this mapping, the counter was never increased, and the local variables conflicted with the arguments. This fix adds proper scoping for declarations and a test-case to cover the scenario with multiple DeclareFuncOps. | 1 年前 | |
[mlir][emitc] Add emitc.do op to the dialect (#143008) This patch adds: - Emission of the corresponding ops in the CppEmitter - Conversion from the SCF dialect to the EmitC dialect for the ops - Corresponding tests | 10 个月前 | |
[mlir][emitc] Inline expressions with side-effects (#161356) So far the translator only inlined expressions having no side effects, as rescheduling their evaluation doesn't break semantics. This patch adds inlining of expressions containing side effects if defined just before their use, e.g., mlir %c = emitc.expression %a, %b : (i32, !emitc.ptr<i32>) -> i32 { %e = emitc.sub %a, %b : (!emitc.ptr<i32>, i32) -> !emitc.ptr<i32> %d = emitc.apply "*"(%e) : (!emitc.ptr<i32>) -> i32 emitc.yield %d : i32 } emitc.return %c : i32 This restriction is meant to keep the translator as simple as possible, leaving it to transformations to analyze and reorder ops as needed in more complicated cases. The patch handles inlining into emitc.return, emitc.if, emitc.switch and (to some extent) emitc.assign. | 10 个月前 | |
[MLIR] emitc: Add emitc.file op (#123298) A emitc.file represents a file that can be emitted into a single C++ file. This allows to manage multiple source files within the same MLIR module, but emit them into separate files. This feature is opt-in. By default, mlir-translate emits all ops outside of emitc.file and ignores all emitc.file ops and their bodies. When specifying the -file-id=id flag, mlir-translate emits all ops outside of emitc.file and the ops within the emitc.file with matching id. Example: mlir emitc.file "main" { func @func_one() { return } } emitc.file "test" { func @func_two() { return } } mlir-translate -file-id=main will emit func_one and mlir-translate -file-id=test will emit func_two. | 1 年前 | |
[mlir][emitc] Isolate expressions from above (#155641) The expression op is currently not isolated from above. This served its original usage as an optional, translation-oriented op, but is becoming less convenient now that expressions appear earlier in the emitc compilation flow and are gaining use as components of other emitc ops. This patch therefore adds the isolated-from-above trait to expressions. Syntactically, the only change is in the expression's signature which now includes the values being used in the expression as arguments and their types. The region's argument's names shadow the used values to keep the def-use relations clear. | 11 个月前 | |
[MLIR][Target/Cpp] Natural induction variable naming. (#136102) Changed naming of loop induction variables to follow natural naming (i, j, k, ...). This helps readability and locating positions referred to. Created new scopes to represent different behavior at function and loop level, to still enable re-using value names between different functions (as before). Removed unused scoping at other levels. | 1 年前 | |
[mlir][emitc] Add ArrayType (#83386) This models a one or multi-dimensional C/C++ array. The type implements the ShapedTypeInterface and prints similar to memref/tensor: %arg0: !emitc.array<1xf32>, %arg1: !emitc.array<10x20x30xi32>, %arg2: !emitc.array<30x!emitc.ptr<i32>>, %arg3: !emitc.array<30x!emitc.opaque<"int">> It can be translated to a C array type when used as function parameter or as emitc.variable type. | 2 年前 | |
[mlir][EmitC] Model lvalues as a type in EmitC (#91475) This adds an emitc.lvalue type which models assignable lvlaues in the type system. Operations modifying memory are restricted to this type accordingly. See also the discussion on [discourse](https://discourse.llvm.org/t/rfc-separate-variables-from-ssa-values-in-emitc/75224/9). The most notable changes are as follows. - emitc.variable and emitc.global ops are restricted to return emitc.array or emitc.lvalue types - Taking the address of a value is restricted to operands with lvalue type - Conversion from lvalues into SSA values is done with the new emitc.load op - The var operand of the emitc.assign op is restricted to lvalue type - The result of the emitc.subscript and emitc.get_global ops is a lvalue type - The operands and results of the emitc.member and emitc.member_of_ptr ops are restricted to lvalue types --------- Co-authored-by: Matthias Gehre <matthias.gehre@amd.com> | 1 年前 | |
[mlir][emitc] Don't emit extra semicolon after bracket (#122464) Extra semicolons were emitted for operations that should never have them, since not every place was checking whether semicolon would be actually needed. Thus change the emitOperation to ignore trailingSemicolon field for such operations. | 1 年前 | |
[mlir][EmitC] Model lvalues as a type in EmitC (#91475) This adds an emitc.lvalue type which models assignable lvlaues in the type system. Operations modifying memory are restricted to this type accordingly. See also the discussion on [discourse](https://discourse.llvm.org/t/rfc-separate-variables-from-ssa-values-in-emitc/75224/9). The most notable changes are as follows. - emitc.variable and emitc.global ops are restricted to return emitc.array or emitc.lvalue types - Taking the address of a value is restricted to operands with lvalue type - Conversion from lvalues into SSA values is done with the new emitc.load op - The var operand of the emitc.assign op is restricted to lvalue type - The result of the emitc.subscript and emitc.get_global ops is a lvalue type - The operands and results of the emitc.member and emitc.member_of_ptr ops are restricted to lvalue types --------- Co-authored-by: Matthias Gehre <matthias.gehre@amd.com> | 1 年前 | |
[mlir][EmitC] Model lvalues as a type in EmitC (#91475) This adds an emitc.lvalue type which models assignable lvlaues in the type system. Operations modifying memory are restricted to this type accordingly. See also the discussion on [discourse](https://discourse.llvm.org/t/rfc-separate-variables-from-ssa-values-in-emitc/75224/9). The most notable changes are as follows. - emitc.variable and emitc.global ops are restricted to return emitc.array or emitc.lvalue types - Taking the address of a value is restricted to operands with lvalue type - Conversion from lvalues into SSA values is done with the new emitc.load op - The var operand of the emitc.assign op is restricted to lvalue type - The result of the emitc.subscript and emitc.get_global ops is a lvalue type - The operands and results of the emitc.member and emitc.member_of_ptr ops are restricted to lvalue types --------- Co-authored-by: Matthias Gehre <matthias.gehre@amd.com> | 1 年前 | |
[mlir][emitc] Fix literal translation (#71296) - Do not emit variables-at-top for literals - Do not emit an error for a missing name for literals used as call operands. | 2 年前 | |
[mlir][emitc] Rename call op to call_opaque (#72494) This renames the emitc.call op to emitc.call_opaque as the existing call op does not refer to the callee by symbol. The rename allows to introduce a new call op alongside with a future emitc.func op to model and facilitate functions and function calls. | 2 年前 | |
[mlir][EmitC] Add logical operators (#83123) This adds operations for the logical operators AND, NOT and OR. | 2 年前 | |
[mlir][EmitC] Model lvalues as a type in EmitC (#91475) This adds an emitc.lvalue type which models assignable lvlaues in the type system. Operations modifying memory are restricted to this type accordingly. See also the discussion on [discourse](https://discourse.llvm.org/t/rfc-separate-variables-from-ssa-values-in-emitc/75224/9). The most notable changes are as follows. - emitc.variable and emitc.global ops are restricted to return emitc.array or emitc.lvalue types - Taking the address of a value is restricted to operands with lvalue type - Conversion from lvalues into SSA values is done with the new emitc.load op - The var operand of the emitc.assign op is restricted to lvalue type - The result of the emitc.subscript and emitc.get_global ops is a lvalue type - The operands and results of the emitc.member and emitc.member_of_ptr ops are restricted to lvalue types --------- Co-authored-by: Matthias Gehre <matthias.gehre@amd.com> | 1 年前 | |
[mlir][emitc] Support array result for emitc.member and emitc.member_of_ptr (#155224) This PR adds array type as a valid result type for emitc.member and emitc.member_of_ptr, enabling direct access and assignment to struct array members in EmitC. | 11 个月前 | |
[mlir][emitc] Don't emit extra semicolon after bracket (#122464) Extra semicolons were emitted for operations that should never have them, since not every place was checking whether semicolon would be actually needed. Thus change the emitOperation to ignore trailingSemicolon field for such operations. | 1 年前 | |
TranslateToCpp: Emit floating point literals with suffix (#85392) Emits 2.0e+00f instead of (float)2.0e+00. This helps consumers of the emitted code, especially when there are large numbers of floating point literals, to have a simple AST. | 2 年前 | |
[mlir][EmitC] Model lvalues as a type in EmitC (#91475) This adds an emitc.lvalue type which models assignable lvlaues in the type system. Operations modifying memory are restricted to this type accordingly. See also the discussion on [discourse](https://discourse.llvm.org/t/rfc-separate-variables-from-ssa-values-in-emitc/75224/9). The most notable changes are as follows. - emitc.variable and emitc.global ops are restricted to return emitc.array or emitc.lvalue types - Taking the address of a value is restricted to operands with lvalue type - Conversion from lvalues into SSA values is done with the new emitc.load op - The var operand of the emitc.assign op is restricted to lvalue type - The result of the emitc.subscript and emitc.get_global ops is a lvalue type - The operands and results of the emitc.member and emitc.member_of_ptr ops are restricted to lvalue types --------- Co-authored-by: Matthias Gehre <matthias.gehre@amd.com> | 1 年前 | |
[mlir][emitc] Isolate expressions from above (#155641) The expression op is currently not isolated from above. This served its original usage as an optional, translation-oriented op, but is becoming less convenient now that expressions appear earlier in the emitc compilation flow and are gaining use as components of other emitc ops. This patch therefore adds the isolated-from-above trait to expressions. Syntactically, the only change is in the expression's signature which now includes the values being used in the expression as arguments and their types. The region's argument's names shadow the used values to keep the def-use relations clear. | 11 个月前 | |
[mlir] Support emit fp16 and bf16 type to cpp (#105803) | 1 年前 | |
[mlir][EmitC] Add unary_{minus,plus} operators (#84329) This adds operations for the unary minus and the unary plus operator. | 2 年前 | |
[mlir][EmitC] Model lvalues as a type in EmitC (#91475) This adds an emitc.lvalue type which models assignable lvlaues in the type system. Operations modifying memory are restricted to this type accordingly. See also the discussion on [discourse](https://discourse.llvm.org/t/rfc-separate-variables-from-ssa-values-in-emitc/75224/9). The most notable changes are as follows. - emitc.variable and emitc.global ops are restricted to return emitc.array or emitc.lvalue types - Taking the address of a value is restricted to operands with lvalue type - Conversion from lvalues into SSA values is done with the new emitc.load op - The var operand of the emitc.assign op is restricted to lvalue type - The result of the emitc.subscript and emitc.get_global ops is a lvalue type - The operands and results of the emitc.member and emitc.member_of_ptr ops are restricted to lvalue types --------- Co-authored-by: Matthias Gehre <matthias.gehre@amd.com> | 1 年前 | |
[MLIR] emitc: Add fmtArgs to verbatim (#123294) Allows to print code snippets that refer to arguments or local variables. E.g. emitc.verbatim "#pragma abc var={}" args %arg0 : !emitc.ptr<i32> is printed as #pragma abc var=v1 when the translator had decided to print %arg0 as v1. As a follow-up PR, we will use the same infra to extend opaque type, which provides a way to generate template types depending on the spelling of other types. | 1 年前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 3 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 4 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 11 个月前 | ||
| 11 个月前 | ||
| 1 年前 | ||
| 10 个月前 | ||
| 10 个月前 | ||
| 1 年前 | ||
| 11 个月前 | ||
| 1 年前 | ||
| 2 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 1 年前 | ||
| 11 个月前 | ||
| 1 年前 | ||
| 2 年前 | ||
| 1 年前 | ||
| 11 个月前 | ||
| 1 年前 | ||
| 2 年前 | ||
| 1 年前 | ||
| 1 年前 |