[all-commits] [llvm/llvm-project] 595a27: [mlir][emitc] Support 'emitc::LValueType' in 'emit...
Andrey Timonin via All-commits
all-commits at lists.llvm.org
Mon Jun 16 07:38:00 PDT 2025
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 595a273d9232a7378c583fb109212370d6d2f4e4
https://github.com/llvm/llvm-project/commit/595a273d9232a7378c583fb109212370d6d2f4e4
Author: Andrey Timonin <timonina1909 at gmail.com>
Date: 2025-06-16 (Mon, 16 Jun 2025)
Changed paths:
M mlir/include/mlir/Dialect/EmitC/IR/EmitC.td
M mlir/test/Dialect/EmitC/ops.mlir
Log Message:
-----------
[mlir][emitc] Support 'emitc::LValueType' in 'emitc::VerbatimOp' (#144151)
This PR introduces support for `emitc::LvalueType` in
`emitc::VerbatimOp`, providing a mechanism to reduce the number of
operations required when working with verbatim operations whose
arguments are of type `emitc::LvalueType`.
Before:
```mlir
emitc.func @foo() {
%a = "emitc.variable"() <{value = #emitc.opaque<"1">}> : () -> !emitc.lvalue<i32>
%loaded_a = load %a : !emitc.lvalue<i32>
emitc.verbatim "{} + {};" args %loaded_a, %loaded_a : i32, i32
return
}
```
After:
```mlir
emitc.func @bar() {
%a = "emitc.variable"() <{value = #emitc.opaque<"1">}> : () -> !emitc.lvalue<i32>
emitc.verbatim "{} + {};" args %a, %a : !emitc.lvalue<i32>, !emitc.lvalue<i32>
return
}
```
You can now write something like this:
```mlir
emitc.func @baz() {
%a = "emitc.variable"() <{value = #emitc.opaque<"1">}> : () -> !emitc.lvalue<i32>
emitc.verbatim "++{};" args %a : !emitc.lvalue<i32>
return
}
```
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list