fix simplify-affine-structures bug
Signed-off-by: Uday Bondhugula <uday@polymagelabs.com> Closes #157 COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/157 from bondhugula:quickfix bd1fcd79825fc0bd5b4a3e688153fa0993ab703d PiperOrigin-RevId: 273316498
This commit is contained in:
parent
9d862a484f
commit
f23e6832c0
@ -102,9 +102,16 @@ void SimplifyAffineStructures::runOnFunction() {
|
||||
}
|
||||
});
|
||||
|
||||
// Turn memrefs' non-identity layouts maps into ones with identity.
|
||||
func.walk([](AllocOp op) { normalizeMemRef(op); });
|
||||
// Turn memrefs' non-identity layouts maps into ones with identity. Collect
|
||||
// alloc ops first and then process since normalizeMemRef replaces/erases ops
|
||||
// during memref rewriting.
|
||||
SmallVector<AllocOp, 4> allocOps;
|
||||
func.walk([&](AllocOp op) { allocOps.push_back(op); });
|
||||
for (auto allocOp : allocOps) {
|
||||
normalizeMemRef(allocOp);
|
||||
}
|
||||
}
|
||||
|
||||
static PassRegistration<SimplifyAffineStructures>
|
||||
pass("simplify-affine-structures", "Simplify affine expressions");
|
||||
pass("simplify-affine-structures",
|
||||
"Simplify affine expressions in maps/sets and normalize memrefs");
|
||||
|
Loading…
x
Reference in New Issue
Block a user