This is an archive of the discontinued LLVM Phabricator instance.

[MLIR][NFC] Minor cleanup in liveness.
ClosedPublic

Authored by jurahul on Jul 23 2021, 12:50 PM.

Details

Summary
  • Rename isLastUse to isDeadAfter to reflect what the function does.
  • Avoid a second walk over all operations in BlockInfoBuilder constructor.
  • use std::move() to save the new in set.

Diff Detail

Event Timeline

jurahul created this revision.Jul 23 2021, 12:50 PM
jurahul requested review of this revision.Jul 23 2021, 12:50 PM
rriddle added inline comments.Jul 23 2021, 12:56 PM
mlir/include/mlir/Analysis/Liveness.h
78

You'll also need to update usages in comments.

mlir/lib/Analysis/Liveness.cpp
69

This changes the behavior of nested regions with multiple blocks, though I don't think nested operations should necessarily be handled by all ancestor blocks.

jurahul marked an inline comment as done.Jul 23 2021, 1:10 PM
jurahul added inline comments.
mlir/lib/Analysis/Liveness.cpp
69

Not sure how it changes the behavior: it looks like all defs in all nested operations are added to defValues and all uses in all nested operations (except the ones in defValues) and that's the behavior of the new code. Note that useValues is empty before this code.

jurahul updated this revision to Diff 361318.Jul 23 2021, 1:12 PM
jurahul marked an inline comment as done.

Update usage in comment

jurahul marked an inline comment as done.Jul 23 2021, 1:12 PM
rriddle accepted this revision.Jul 23 2021, 1:13 PM
rriddle added inline comments.
mlir/lib/Analysis/Liveness.cpp
69

Right right, misread the comment there.

This revision is now accepted and ready to land.Jul 23 2021, 1:13 PM
This revision was landed with ongoing or failed builds.Jul 23 2021, 1:30 PM
This revision was automatically updated to reflect the committed changes.