[PATCH] D74893: [mlir] Intrinsics generator: use TableGen-defined builder function
Alex Zinenko via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 24 05:46:41 PST 2020
ftynse marked an inline comment as done.
ftynse added inline comments.
================
Comment at: mlir/include/mlir/Dialect/LLVMIR/LLVMOpBase.td:149
+ : LLVM_IntrOpBase<LLVM_Dialect, "intr." # mnem, !subst(".", "_", mnem),
+ overloadedResults, overloadedOperands, traits, hasResult>;
+
----------------
kariddi wrote:
> kariddi wrote:
> > What is the story to convert MLIR operations with multiple return values into intrinsics returning multiple values (structures)?
> If everything would pan out just fine for multiple results I suggest renaming "hasResult" with "hasResults"
This should happen within MLIR, on in the translation from MLIR to LLVM IR. Since we want to model LLVM IR closely in the LLVM dialect, intrinsics that return a struct (that consumers will have to "unpack" with extractvalue) are modeled as Ops that return a single value of the corresponding type. Anyone is free to introduce a slightly higher-level operation that has multiple results instead, which would be lowered to this intrinsic. We have support for generating the "unpacking" since day 1 (https://github.com/llvm/llvm-project/commit/6d37a255e2e445671e30b7471283b985cbb34727#diff-bab3c5c46bbcf237dbcfcd8a2a668454R354).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D74893/new/
https://reviews.llvm.org/D74893
More information about the llvm-commits
mailing list