[MLIR][Vector] Allow non-default memory spaces in gather/scatter lowerings (#67500)

GPU targets can gather on non-default address spaces (e.g. global), so
this removes the check for the default memory space.
This commit is contained in:
Quinn Dawkins
2023-09-28 19:20:32 -04:00
committed by GitHub
parent 7ddf7d8783
commit 78c49743c7
2 changed files with 16 additions and 4 deletions

View File

@@ -87,14 +87,12 @@ LogicalResult getMemRefAlignment(const LLVMTypeConverter &typeConverter,
return success();
}
// Check if the last stride is non-unit or the memory space is not zero.
// 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))
return failure();
FailureOr<unsigned> addressSpace =
converter.getMemRefAddressSpace(memRefType);
if (failed(addressSpace) || *addressSpace != 0)
if (failed(converter.getMemRefAddressSpace(memRefType)))
return failure();
return success();
}