diff options
author | Benjamin Maxwell <benjamin.maxwell@arm.com> | 2023-11-23 10:12:12 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-23 10:12:12 +0000 |
commit | dbb86433333154226233da46271e8c520e8a5119 (patch) | |
tree | 5785b0c3585d41baeda6dbe3a37c8530852e9f13 /clang/lib/Frontend/TestModuleFileExtension.cpp | |
parent | 9b374a800d18c02cc7881774c73352876f9e0cef (diff) | |
download | llvm-dbb86433333154226233da46271e8c520e8a5119.zip llvm-dbb86433333154226233da46271e8c520e8a5119.tar.gz llvm-dbb86433333154226233da46271e8c520e8a5119.tar.bz2 |
[mlir][LLVM] Support `immargs` in LLVM_IntrOpBase intrinsics (#73013)
This extends `LLVM_IntrOpBase` so that it can be passed a list of
`immArgPositions` and a list (of the same length) of `immArgAttrNames`.
`immArgPositions` contains the positions of `immargs` on the LLVM IR
intrinsic, and `immArgAttrNames` maps those to a corresponding MLIR
attribute.
This allows modeling LLVM `immargs` as MLIR attributes, which is the
closest match semantically (and had already been done manually for the
LLVM dialect intrinsics).
This has two upsides:
* It's slightly easier to implement intrinsics with immargs now
(especially if they make use of other features, such as overloads)
* It clearly defines that `immargs` should map to attributes, before
there was no mention of `immargs` in LLVMOpBase.td, so implementing them
was unclear
This works with other features of the `LLVM_IntrOpBase`, so `immargs`
can be marked as overloaded too (which is used in some intrinsics).
As part of this patch (and to test correctness) existing intrinsics have
been updated to use these new parameters.
This also uncovered a few issues with the
`llvm.intr.vector.insert/extract` intrinsics. First, the argument order
for insert did not match the LLVM intrinsic, and secondly, both were
missing a mlirBuilder (so failed to import from LLVM IR). This is
corrected with this patch (and a test case added).
Diffstat (limited to 'clang/lib/Frontend/TestModuleFileExtension.cpp')
0 files changed, 0 insertions, 0 deletions