diff options
Diffstat (limited to 'mlir/lib/Dialect/LLVMIR/IR/LLVMInlining.cpp')
-rw-r--r-- | mlir/lib/Dialect/LLVMIR/IR/LLVMInlining.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/mlir/lib/Dialect/LLVMIR/IR/LLVMInlining.cpp b/mlir/lib/Dialect/LLVMIR/IR/LLVMInlining.cpp index 65c1dae..4a6154e 100644 --- a/mlir/lib/Dialect/LLVMIR/IR/LLVMInlining.cpp +++ b/mlir/lib/Dialect/LLVMIR/IR/LLVMInlining.cpp @@ -663,6 +663,10 @@ struct LLVMInlinerInterface : public DialectInlinerInterface { << "Cannot inline: callable is not an LLVM::LLVMFuncOp\n"); return false; } + if (funcOp.isVarArg()) { + LLVM_DEBUG(llvm::dbgs() << "Cannot inline: callable is variadic\n"); + return false; + } // TODO: Generate aliasing metadata from noalias argument/result attributes. if (auto attrs = funcOp.getArgAttrs()) { for (DictionaryAttr attrDict : attrs->getAsRange<DictionaryAttr>()) { @@ -704,7 +708,8 @@ struct LLVMInlinerInterface : public DialectInlinerInterface { } bool isLegalToInline(Operation *op, Region *, bool, IRMapping &) const final { - return true; + // The inliner cannot handle variadic function arguments. + return !isa<LLVM::VaStartOp>(op); } /// Handle the given inlined return by replacing it with a branch. This |