Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ void eliminateVectorMasks(IRRewriter &rewriter, FunctionOpInterface function,
if (!vscaleRange)
return;

// Early exit for functions without a body.
if (function.isExternal())
return;

OpBuilder::InsertionGuard g(rewriter);

// Build worklist so we can safely insert new ops in
Expand Down
6 changes: 6 additions & 0 deletions mlir/test/Dialect/Vector/eliminate-masks.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -163,3 +163,9 @@ func.func @negative_value_bounds_scalable_dim_not_all_true(%tensor: tensor<2x100
"test.some_use"(%mask) : (vector<3x[4]xi1>) -> ()
return
}

// -----

// Test to ensure that functions without a body are skipped.
// CHECK-LABEL: func.func private @decl_only(tensor<*xi32>)
func.func private @decl_only(tensor<*xi32>)