Skip to content

Commit

Permalink
use upstream utility
Browse files Browse the repository at this point in the history
Signed-off-by: Nirvedh <[email protected]>
  • Loading branch information
nirvedhmeshram committed Nov 12, 2024
1 parent ddcaeda commit 900a1d3
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions compiler/src/iree/compiler/Codegen/Utils/Utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1511,11 +1511,6 @@ computeDimUpperBound(Value shapedValue, unsigned dimNum,
return roundedDimBound.getSize();
}

static bool isAllConstantValue(ArrayRef<OpFoldResult> ofrs, int64_t v) {
return llvm::all_of(
ofrs, [&](OpFoldResult ofr) { return isConstantIntValue(ofr, v); });
}

static bool isFullSlice(ArrayRef<OpFoldResult> mixedOffsets,
ArrayRef<OpFoldResult> mixedSizes,
ArrayRef<OpFoldResult> mixedStrides,
Expand All @@ -1525,8 +1520,9 @@ static bool isFullSlice(ArrayRef<OpFoldResult> mixedOffsets,
SmallVector<int64_t> tensorShape = llvm::to_vector(tensorType.getShape());
SmallVector<OpFoldResult> mixedTensorShape =
mlir::getMixedValues(tensorShape, dynamicDims, builder);
return isAllConstantValue(mixedOffsets, 0) &&
isAllConstantValue(mixedStrides, 1) && mixedTensorShape == mixedSizes;
return areAllConstantIntValue(mixedOffsets, 0) &&
areAllConstantIntValue(mixedStrides, 1) &&
mixedTensorShape == mixedSizes;
}

bool isFullSlice(OffsetSizeAndStrideOpInterface sliceLoadStoreOp,
Expand Down

0 comments on commit 900a1d3

Please sign in to comment.