We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f418319 commit 4396126Copy full SHA for 4396126
mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorConversion.cpp
@@ -592,8 +592,12 @@ class SparseTensorInsertConverter : public OpConversionPattern<InsertOp> {
592
Value lvlCoords, vref;
593
{
594
OpBuilder::InsertionGuard guard(rewriter);
595
- auto loop = op->getParentOfType<LoopLikeOpInterface>();
596
- if (loop) {
+ Operation *loop = op;
+ // Finds the outermost loop.
597
+ while (auto l = loop->getParentOfType<LoopLikeOpInterface>())
598
+ loop = l;
599
+
600
+ if (llvm::isa<LoopLikeOpInterface>(loop)) {
601
// Hoists alloca outside the loop to avoid stack overflow.
602
rewriter.setInsertionPoint(loop);
603
}
0 commit comments