File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -439,7 +439,7 @@ bool mlir::hasMemoryEffectConflict(
439
439
llvm::SmallVector<MemoryEffects::EffectInstance> effects;
440
440
memInterface.getEffects (effects);
441
441
442
- auto isDominated = dom.properlyDominates (mainOp, op);
442
+ bool isDominated = dom.properlyDominates (mainOp, op);
443
443
444
444
// ensure op only has Write or dominated Read effects
445
445
// check used resources
@@ -448,9 +448,8 @@ bool mlir::hasMemoryEffectConflict(
448
448
449
449
if (resourceCounts.contains (resourceID)) {
450
450
if (isa<MemoryEffects::Read>(effect.getEffect ())) {
451
- if (isDominated) {
451
+ if (isDominated)
452
452
continue ; // skip dominated reads
453
- }
454
453
}
455
454
else if (!isa<MemoryEffects::Write>(effect.getEffect ())) {
456
455
return true ; // count alloc/free in same region as conflict, be conservative
@@ -462,6 +461,11 @@ bool mlir::hasMemoryEffectConflict(
462
461
}
463
462
}
464
463
}
464
+ } else if (!op->hasTrait <OpTrait::HasRecursiveMemoryEffects>()) {
465
+ // Otherwise, if the op does not implement the memory effect interface and
466
+ // it does not have recursive side effects, then it cannot be known that the
467
+ // op is conflicting or not.
468
+ return true ;
465
469
}
466
470
467
471
// Recurse into the regions and ensure that nested ops don't
You can’t perform that action at this time.
0 commit comments