This is an archive of the discontinued LLVM Phabricator instance.

[IRSim] Ensure that assignment accurately reduces potential mapping between different candidates
ClosedPublic

Authored by AndrewLitteken on Dec 5 2022, 8:43 AM.

Details

Summary

Previous
When we do not make decisions about commutative operands, we can end up in a situation where two values have two potential canonical numbers between two regions. This ensures that an ordering is decided after the initial structure between two regions is determined.

Current:
Previously the outliner only checked that assignment to a value matched what was already known, this patch makes sure that it matches what has already been found, and creates a mapping between the two values where it is a one-to-one mapping.

Diff Detail

Event Timeline

AndrewLitteken created this revision.Dec 5 2022, 8:43 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 5 2022, 8:43 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
AndrewLitteken requested review of this revision.Dec 5 2022, 8:43 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 5 2022, 8:43 AM

Is this one of the compile time patches we discussed offline? If so, could you mention that + an overview of the improvements in the commit message?

AndrewLitteken added a comment.EditedDec 6 2022, 10:45 AM

Is this one of the compile time patches we discussed offline? If so, could you mention that + an overview of the improvements in the commit message?

This is a bug fix that needs to be made prior to committing the compile time patches that shows up when you start making that optimization.

Is it possible to write a testcase?

I could write a test case that would become a problem if this was not implemented when https://reviews.llvm.org/D139338 is merged on top of it. But I can't write a test case that would fail without this check for the current version of the outliner.

AndrewLitteken retitled this revision from [IRSim] Make Decisions about commutative operands to [IRSim] Ensure that assignment accurately reduces potential mapping between different candidates.
AndrewLitteken edited the summary of this revision. (Show Details)
paquette accepted this revision.Mar 17 2023, 10:49 AM

I think this looks good, with a nit.

llvm/lib/Analysis/IRSimilarityIdentifier.cpp
833

would it be possible to pull this out into a lambda/function?

This revision is now accepted and ready to land.Mar 17 2023, 10:49 AM
This revision was landed with ongoing or failed builds.Mar 20 2023, 7:53 AM
This revision was automatically updated to reflect the committed changes.