diff options
author | Fabian Mora <fmora.dev@gmail.com> | 2025-04-22 18:32:16 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-04-22 18:32:16 -0400 |
commit | e112dccc8ba49425c575a6b15325f2cbeef5c606 (patch) | |
tree | 2ab5602267e4183f5c9d017ad1823373a7b000d0 /clang/lib/Frontend/CompilerInstance.cpp | |
parent | 09147b4c3c5579e9d76aa090605ccc9b46e307f6 (diff) | |
download | llvm-e112dccc8ba49425c575a6b15325f2cbeef5c606.zip llvm-e112dccc8ba49425c575a6b15325f2cbeef5c606.tar.gz llvm-e112dccc8ba49425c575a6b15325f2cbeef5c606.tar.bz2 |
[mlir][ptr] Add the `ptradd` and `type_offset` ops, and `generic_space` attr (#136434)
This patch adds the `ptr.ptradd` and `ptr.type_offset` operations. Given
a `ptr` value these operations can be used to compute new addresses. For
example:
```mlir
func.func @ops0(%ptr: !ptr.ptr<#ptr.int_space>) -> !ptr.ptr<#ptr.int_space> {
%off = ptr.type_offset f32 : index
%res = ptr.ptradd %ptr, %off : !ptr.ptr<#ptr.int_space>, index
return %res : !ptr.ptr<#ptr.int_space>
}
```
Additionally, this patch also adds the `#ptr.generic_space`. This memory
space allows loading and storing values to all types.
---------
Co-authored-by: Mehdi Amini <joker.eph@gmail.com>
Co-authored-by: Tobias Gysi <tobias.gysi@nextsilicon.com>
Diffstat (limited to 'clang/lib/Frontend/CompilerInstance.cpp')
0 files changed, 0 insertions, 0 deletions