Page MenuHomePhabricator

[mlir][Affine] Fix AffineLoopInvariantCodeMotion
ClosedPublic

Authored by dcaballe on Tue, Sep 1, 3:01 PM.

Details

Summary

Make sure that memory ops that are defined inside the loop are registered
as such in 'defineOp'. In the test provided, the 'mulf' op was hoisted
outside the loop nest even when its 'affine.load' operand was not.

Diff Detail

Event Timeline

dcaballe created this revision.Tue, Sep 1, 3:01 PM
Herald added a project: Restricted Project. · View Herald TranscriptTue, Sep 1, 3:01 PM
dcaballe requested review of this revision.Tue, Sep 1, 3:01 PM
bondhugula added inline comments.Tue, Sep 1, 7:36 PM
mlir/lib/Dialect/Affine/Transforms/AffineLoopInvariantCodeMotion.cpp
87

The comment is a bit redundant. Either drop or replace it with something that indicates what it means to add it to the definedOps.

mlir/test/Dialect/Affine/affine-loop-invariant-code-motion.mlir
542

This has in general nothing to do with mul specifically, but any side-effect free op consuming the load result?

dcaballe updated this revision to Diff 289500.Wed, Sep 2, 9:47 AM
dcaballe marked 2 inline comments as done.

Addressed feedback. Thanks!

bondhugula accepted this revision.Wed, Sep 2, 10:31 AM

Thanks!

mlir/lib/Dialect/Affine/Transforms/AffineLoopInvariantCodeMotion.cpp
89

are are -> are

89

which are not -> which are themselves not
?

This revision is now accepted and ready to land.Wed, Sep 2, 10:31 AM
This revision was automatically updated to reflect the committed changes.