Skip to content

Commit dbd2864

Browse files
authored
[Arc][SplitFuncs] Ignore extern func ops (#9393)
1 parent b3a1e6c commit dbd2864

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

lib/Dialect/Arc/Transforms/SplitFuncs.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,13 @@ struct SplitFuncsPass : public arc::impl::SplitFuncsBase<SplitFuncsPass> {
4747

4848
void SplitFuncsPass::runOnOperation() {
4949
symbolTable = &getAnalysis<SymbolTable>();
50-
for (auto op : llvm::make_early_inc_range(getOperation().getOps<FuncOp>()))
50+
for (auto op : llvm::make_early_inc_range(getOperation().getOps<FuncOp>())) {
51+
// Ignore extern functions
52+
if (op.isExternal())
53+
continue;
5154
if (failed(lowerFunc(op)))
5255
return signalPassFailure();
56+
}
5357
}
5458

5559
LogicalResult SplitFuncsPass::lowerFunc(FuncOp funcOp) {

test/Dialect/Arc/split-funcs.mlir

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,7 @@ func.func @LongReuse(%arg1: i4, %arg2: i4) -> (i4) {
4949
%4 = comb.add %0, %1 : i4
5050
return %4 : i4
5151
}
52+
53+
// Ignore extern functions
54+
// CHECK-LABEL: func.func private @extern()
55+
func.func private @extern()

0 commit comments

Comments
 (0)