[Mlir-commits] [mlir] 0fac44d - [mlir][linalg] check if a function has a body during detensorizing
Okwan Kwon
llvmlistbot at llvm.org
Tue May 2 15:39:33 PDT 2023
Author: Okwan Kwon
Date: 2023-05-02T15:39:00-07:00
New Revision: 0fac44d80715ba04a7567346d1832d3b4f019f34
URL: https://github.com/llvm/llvm-project/commit/0fac44d80715ba04a7567346d1832d3b4f019f34
DIFF: https://github.com/llvm/llvm-project/commit/0fac44d80715ba04a7567346d1832d3b4f019f34.diff
LOG: [mlir][linalg] check if a function has a body during detensorizing
A func may not have a body.
Differential Revision: https://reviews.llvm.org/D149688
Added:
Modified:
mlir/lib/Dialect/Linalg/Transforms/Detensorize.cpp
Removed:
################################################################################
diff --git a/mlir/lib/Dialect/Linalg/Transforms/Detensorize.cpp b/mlir/lib/Dialect/Linalg/Transforms/Detensorize.cpp
index 9012a634a241..5fd48853875c 100644
--- a/mlir/lib/Dialect/Linalg/Transforms/Detensorize.cpp
+++ b/mlir/lib/Dialect/Linalg/Transforms/Detensorize.cpp
@@ -476,6 +476,9 @@ struct LinalgDetensorize
DenseSet<BlockArgument> blockArgsToDetensor;
FunctionOpInterface funcOp = getOperation();
+ if (funcOp.getFunctionBody().empty())
+ return;
+
// Make sure the entry block of the function doesn't contain any Linalg ops.
// Otherwise, it may lead to the signature of the block being changed by the
// dialect conversion below, which would make the function op invalid
More information about the Mlir-commits
mailing list