[mlir][VectorOps] Redo the scalar loop emission in VectoToSCF to pad instead of clipping
This replaces the select chain for edge-padding with an scf.if that performs the memory operation when the index is in bounds and uses the pad value when it's not. For transfer_write the same mechanism is used, skipping the store when the index is out of bounds. The integration test has a bunch of cases of how I believe this should work. Differential Revision: https://reviews.llvm.org/D87241
This commit is contained in:
@@ -1096,7 +1096,7 @@ static bool isContiguous(MemRefType memRefType,
|
||||
SmallVectorImpl<int64_t> &strides) {
|
||||
int64_t offset;
|
||||
auto successStrides = getStridesAndOffset(memRefType, strides, offset);
|
||||
bool isContiguous = (strides.back() == 1);
|
||||
bool isContiguous = strides.empty() || strides.back() == 1;
|
||||
if (isContiguous) {
|
||||
auto sizes = memRefType.getShape();
|
||||
for (int index = 0, e = strides.size() - 2; index < e; ++index) {
|
||||
|
||||
Reference in New Issue
Block a user