This is an archive of the discontinued LLVM Phabricator instance.

[mlir][Transforms] Simplify region before simplifying operation in CSE.
ClosedPublic

Authored by mravishankar on Dec 6 2022, 5:04 PM.

Details

Summary

This covers more options for CSE. It also ensures that two operations
that have same operands but different regions to begin with, but same
regions after simplifyRegions, don't get both added to the list of
knownValues.

Fixes #59135

Diff Detail

Event Timeline

mravishankar created this revision.Dec 6 2022, 5:04 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 6 2022, 5:04 PM
mravishankar requested review of this revision.Dec 6 2022, 5:04 PM
mravishankar added inline comments.
mlir/test/Transforms/cse.mlir
465

Damn, forgot to write the actual CHECKs. Will update shortly.

Makes sense to me!

mlir/lib/Transforms/CSE.cpp
319

This will miss the possible simplification of the region op?

Add missing CHECK lines.

Refactor to account for invalid continue.

mlir/lib/Transforms/CSE.cpp
319

Good catch! Hopefully this is fixed now...

Mogball accepted this revision.Dec 6 2022, 6:16 PM

Thanks for the fix

This revision is now accepted and ready to land.Dec 6 2022, 6:16 PM
rriddle accepted this revision.Dec 7 2022, 12:18 PM

Forgot to hit approve, but LGTM of course.

This revision was landed with ongoing or failed builds.Dec 7 2022, 3:11 PM
This revision was automatically updated to reflect the committed changes.