This is an archive of the discontinued LLVM Phabricator instance.

[SCEV][NFC] More efficient caching in CompareValueComplexity
ClosedPublic

Authored by mkazantsev on Nov 24 2017, 4:54 AM.

Details

Summary

Currently, we use a set of pairs to cache responces like CompareValueComplexity(X, Y) == 0. If we had
proved that CompareValueComplexity(S1, S2) == 0 and CompareValueComplexity(S2, S3) == 0,
this cache does not allow us to prove that CompareValueComplexity(S1, S3) is also 0.

This patch replaces this set with EquivalenceClasses that merges Values into equivalence sets so that
any two values from the same set are equal from point of CompareValueComplexity . This, in particular,
allows us to prove the fact from example above.

Diff Detail

Repository
rL LLVM

Event Timeline

sanjoy accepted this revision.Nov 24 2017, 1:30 PM
This revision is now accepted and ready to land.Nov 24 2017, 1:30 PM
mkazantsev edited the summary of this revision. (Show Details)
mkazantsev added a reviewer: dberlin.

Reused EquivalenceClasses which is the default implementation of DSU in LLVM instead of the custom one.

This revision was automatically updated to reflect the committed changes.