Introduce support for variadic function signatures for the LLVM dialect
authorAlex Zinenko <zinenko@google.com>
Thu, 8 Aug 2019 16:41:48 +0000 (09:41 -0700)
committerA. Unique TensorFlower <gardener@tensorflow.org>
Thu, 8 Aug 2019 16:42:16 +0000 (09:42 -0700)
commit0126dcf1f0a132388286d3e979b50cc464c352fd
tree6d68e18d124b5035b296d2310cd4f9227358fca6
parent4d6b5493394c83a359c249e7ef46954f77054d6c
Introduce support for variadic function signatures for the LLVM dialect

LLVM function type has first-class support for variadic functions.  In the
current lowering pipeline, it is emulated using an attribute on functions of
standard function type.  In LLVMFuncOp that has LLVM function type, this can be
modeled directly.  Introduce parsing support for variadic arguments to the
function and use it to support variadic function declarations in LLVMFuncOp.
Function definitions are currently not supported as that would require modeling
va_start/va_end LLVM intrinsics in the dialect and we don't yet have a
consistent story for LLVM intrinsics.

PiperOrigin-RevId: 262372651
12 files changed:
mlir/include/mlir/IR/FunctionSupport.h
mlir/include/mlir/IR/OpImplementation.h
mlir/include/mlir/LLVMIR/LLVMOps.td
mlir/lib/IR/Function.cpp
mlir/lib/IR/FunctionSupport.cpp
mlir/lib/LLVMIR/IR/LLVMDialect.cpp
mlir/lib/Parser/Lexer.cpp
mlir/lib/Parser/Lexer.h
mlir/lib/Parser/Parser.cpp
mlir/lib/Parser/TokenKinds.def
mlir/test/IR/invalid.mlir
mlir/test/LLVMIR/func.mlir