diff options
author | Bruno Cardoso Lopes <bruno.cardoso@gmail.com> | 2025-04-07 17:53:18 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-04-07 17:53:18 -0700 |
commit | a168ddc470825091ad52da12042fb38491ed81d6 (patch) | |
tree | 7d33d54cba23944226b1ca049003d57852f08c47 /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | 1a9928442b7dbcd596d6b577809c22330706ccb5 (diff) | |
download | llvm-a168ddc470825091ad52da12042fb38491ed81d6.zip llvm-a168ddc470825091ad52da12042fb38491ed81d6.tar.gz llvm-a168ddc470825091ad52da12042fb38491ed81d6.tar.bz2 |
[MLIR][LLVM] Block address support (#134335)
Add support for import and translate.
MLIR does not support using basic block references outside a function
(like LLVM does), This PR does not consider changes to MLIR to that
respect. It instead introduces two new ops: `llvm.blockaddress` and
`llvm.blocktag`. Here's an example:
```
llvm.func @ba() -> !llvm.ptr {
%0 = llvm.blockaddress <function = @ba, tag = <id = 1>> : !llvm.ptr
llvm.br ^bb1
^bb1: // pred: ^bb0
llvm.blocktag <id = 1>
llvm.return %0 : !llvm.ptr
}
```
Value `%0` hold the address of block tagged as `id = 1` in function
`@ba`. Block tags need to be unique within a function and use of
`llvm.blockaddress` requires a matching tag in a `llvm.blocktag`.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
0 files changed, 0 insertions, 0 deletions