[mlir][IR][NFC] Move free-standing functions to MemRefType (#123465)
Turn free-standing `MemRefType`-related helper functions in `BuiltinTypes.h` into member functions.
This commit is contained in:
committed by
GitHub
parent
79231a8684
commit
6aaa8f25b6
@@ -91,7 +91,7 @@ LogicalResult getMemRefAlignment(const LLVMTypeConverter &typeConverter,
|
||||
// Check if the last stride is non-unit and has a valid memory space.
|
||||
static LogicalResult isMemRefTypeSupported(MemRefType memRefType,
|
||||
const LLVMTypeConverter &converter) {
|
||||
if (!isLastMemrefDimUnitStride(memRefType))
|
||||
if (!memRefType.isLastDimUnitStride())
|
||||
return failure();
|
||||
if (failed(converter.getMemRefAddressSpace(memRefType)))
|
||||
return failure();
|
||||
@@ -1374,7 +1374,7 @@ static std::optional<SmallVector<int64_t, 4>>
|
||||
computeContiguousStrides(MemRefType memRefType) {
|
||||
int64_t offset;
|
||||
SmallVector<int64_t, 4> strides;
|
||||
if (failed(getStridesAndOffset(memRefType, strides, offset)))
|
||||
if (failed(memRefType.getStridesAndOffset(strides, offset)))
|
||||
return std::nullopt;
|
||||
if (!strides.empty() && strides.back() != 1)
|
||||
return std::nullopt;
|
||||
|
||||
Reference in New Issue
Block a user