This is an archive of the discontinued LLVM Phabricator instance.

NewGVN: Fix PR31480, PR31483, PR31499, by rewriting how memory congruence handling works.
ClosedPublic

Authored by dberlin on Dec 30 2016, 11:52 PM.

Details

Summary

Previously, we tried to fix up the equivalences during symbolic evaluation. This does not work. Now, we change the equivalences during congruence finding, where it belongs. We also initialize the equivalence table to give a maximal answer.

Diff Detail

Repository
rL LLVM

Event Timeline

dberlin retitled this revision from to NewGVN: Fix PR31480, PR31483, PR31499, by rewriting how memory congruence handling works..
dberlin updated this object.
dberlin added a reviewer: davide.
dberlin added a subscriber: llvm-commits.
davide edited edge metadata.Jan 2 2017, 9:37 AM

Thanks for working on this! Some initial comments inline.

lib/Transforms/Scalar/NewGVN.cpp
776–781 ↗(On Diff #82757)

This can maybe be expressed using a one-liner with the ternary operator, I find it slightly better, if you think this version is more readable you can keep it as is (I don't have a strong opinion).

1056–1064 ↗(On Diff #82757)

These two changes look like they can be committed in isolation (the improved debug message && the assertion), unless the latter fires without this change.

1104–1110 ↗(On Diff #82757)

This comment looks formatted in a strange way -- it could just be phab, in that case please ignore.

1114 ↗(On Diff #82757)

s/expresion/expressions/

1591–1594 ↗(On Diff #82757)

Yay for the verifier. We should keep this under NDEBUG anyway as there's no bot handling LLVM_EXPENSIVE_CHECKS (because, such a shame, there are still tests failing in that configuration).

This revision was automatically updated to reflect the committed changes.

Ugh.
Sorry, i dcommitted the wrong branch.
Fixes coming!

Comments should be addressed in r290820, please feel free to add any more and i'll happily keep addressing them.

the testcase is on the other branch, i'll move it over.