Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions mlir/lib/Dialect/LLVMIR/Transforms/InlinerInterfaceImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -663,8 +663,6 @@ struct LLVMInlinerInterface : public DialectInlinerInterface {

bool isLegalToInline(Operation *call, Operation *callable,
bool wouldBeCloned) const final {
if (!wouldBeCloned)
return false;
if (!isa<LLVM::CallOp>(call)) {
LLVM_DEBUG(llvm::dbgs() << "Cannot inline: call is not an '"
<< LLVM::CallOp::getOperationName() << "' op\n");
Expand Down
13 changes: 13 additions & 0 deletions mlir/test/Dialect/LLVMIR/inlining.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -663,3 +663,16 @@ llvm.func @caller() {
llvm.call @vararg_intrinrics() : () -> ()
llvm.return
}

// -----

llvm.func @private_func(%a : i32) -> i32 attributes {sym_visibility = "private"} {
llvm.return %a : i32
}

// CHECK-LABEL: func @caller
llvm.func @caller(%x : i32) -> i32 {
// CHECK-NOT: llvm.call @private_func
%z = llvm.call @private_func(%x) : (i32) -> (i32)
llvm.return %z : i32
}
Loading