File tree Expand file tree Collapse file tree 2 files changed +12
-21
lines changed
include/mlir/Dialect/Linalg/IR Expand file tree Collapse file tree 2 files changed +12
-21
lines changed Original file line number Diff line number Diff line change @@ -983,26 +983,6 @@ def LinalgStructuredInterface : OpInterface<"LinalgOp"> {
983
983
return detail::canOpOperandsBeDroppedImpl($_op, droppedOperands);
984
984
}]
985
985
>,
986
- InterfaceMethod<
987
- /*desc=*/[{
988
- Return the range of position in the result of the affine map
989
- computed by getLoopsToShapesMap() which correspond to the
990
- AffineExprs used to access the outputs of the operation.
991
- }],
992
- /*retTy=*/"std::pair<int64_t, int64_t>",
993
- /*methodName=*/"getResultsPositionInLoopsToShapeMap",
994
- /*args=*/(ins),
995
- /*methodBody=*/"",
996
- /*defaultImplementation=*/[{
997
- int64_t inputRankSum = 0;
998
- int64_t outputRankSum = 0;
999
- for(OpOperand *input : getInputOperands())
1000
- inputRankSum += getRank(input);
1001
- for(OpOperand *output : getOutputOperands())
1002
- outputRankSum += getRank(output);
1003
- return {inputRankSum, inputRankSum + outputRankSum};
1004
- }]
1005
- >,
1006
986
InterfaceMethod<
1007
987
/*desc=*/[{
1008
988
Like `getShape`, but only returns statically-known information, without
Original file line number Diff line number Diff line change @@ -566,6 +566,17 @@ struct HasAffineDimExprVisitor
566
566
llvm::SmallBitVector positions;
567
567
};
568
568
569
+ static std::pair<int64_t , int64_t >
570
+ getResultsPositionInLoopsToShapeMap (LinalgOp &op) {
571
+ int64_t inputRankSum = 0 ;
572
+ int64_t outputRankSum = 0 ;
573
+ for (OpOperand *input : op.getInputOperands ())
574
+ inputRankSum += op.getRank (input);
575
+ for (OpOperand *output : op.getOutputOperands ())
576
+ outputRankSum += op.getRank (output);
577
+ return {inputRankSum, inputRankSum + outputRankSum};
578
+ }
579
+
569
580
LogicalResult
570
581
LinalgOp::reifyResultShapes (OpBuilder &b,
571
582
ReifiedRankedShapedTypeDims &reifiedReturnShapes) {
@@ -582,7 +593,7 @@ LinalgOp::reifyResultShapes(OpBuilder &b,
582
593
583
594
// Find the position in the above map that represents the shape of the
584
595
// result:dim being inferred.
585
- auto resultShapesSubMapPos = getResultsPositionInLoopsToShapeMap ();
596
+ auto resultShapesSubMapPos = getResultsPositionInLoopsToShapeMap (* this );
586
597
587
598
// / From loopsToShapesMap extract the submap that represents the shape of the
588
599
// / (resultIdx, dim) needed.
You can’t perform that action at this time.
0 commit comments