Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion mlir/lib/Dialect/Affine/Analysis/AffineAnalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "mlir/Dialect/Affine/IR/AffineValueMap.h"
#include "mlir/Interfaces/SideEffectInterfaces.h"
#include "mlir/Interfaces/ViewLikeInterface.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/TypeSwitch.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
Expand Down Expand Up @@ -468,7 +469,18 @@ LogicalResult MemRefAccess::getAccessRelation(IntegerRelation &rel) const {

// Merge and align domain ids of `rel` with ids of `domain`. Since the domain
// of the access map is a subset of the domain of access, the domain ids of
// `rel` are guranteed to be a subset of ids of `domain`.
// `rel` should be a subset of ids of `domain`. If not, return failure.

for (unsigned i = 0, e = rel.getNumDimVars(); i < e; ++i) {
if (rel.getVarKindAt(i) != VarKind::SetDim)
continue;
Identifier idi = rel.getIds(VarKind::SetDim)[i];
ArrayRef<Identifier> domainIds = domain.getIds(VarKind::SetDim);
if (llvm::is_contained(domainIds, idi)) {
return failure();
}
}

unsigned inserts = 0;
for (unsigned i = 0, e = domain.getNumDimVars(); i < e; ++i) {
const Identifier domainIdi = Identifier(domain.getValue(i));
Expand Down