mirror of
https://github.com/intel/llvm.git
synced 2026-02-01 17:07:36 +08:00
[mlir][Vector] Avoid infinite loop in InnerOuterDimReductionConversion.
This patterns tries to convert an inner (outer) dim reduction to an outer (inner) dim reduction. Doing this on a 1D or 0D vector results in an infinite loop since the converted op is same as the original operation. Just returning failure when source rank <= 1 fixes the issue. Differential Revision: https://reviews.llvm.org/D115426
This commit is contained in:
@@ -41,6 +41,9 @@ public:
|
||||
auto src = multiReductionOp.source();
|
||||
auto loc = multiReductionOp.getLoc();
|
||||
auto srcRank = multiReductionOp.getSourceVectorType().getRank();
|
||||
// If the rank is less than or equal to 1, there is nothing to do.
|
||||
if (srcRank <= 1)
|
||||
return failure();
|
||||
|
||||
// Separate reduction and parallel dims
|
||||
auto reductionDimsRange =
|
||||
|
||||
Reference in New Issue
Block a user