This is an archive of the discontinued LLVM Phabricator instance.

Added InstCombine transform for pattern "(A & B) ^ (A ^ B) -> (A | B)"
ClosedPublic

Authored by suyog on Jul 22 2014, 6:22 AM.

Details

Summary

This patch implements transform for pattern "(A & B) ^ (A ^ B) -> (A | B)"

Please help in reviewing the same.

Thanks,
Suyog

Diff Detail

Event Timeline

suyog updated this revision to Diff 11744.Jul 22 2014, 6:22 AM
suyog retitled this revision from to Added InstCombine transform for pattern "(A & B) ^ (A ^ B) -> (A | B)".
suyog updated this object.
suyog edited the test plan for this revision. (Show Details)
suyog added reviewers: dexonsmith, nicholas, rafael.
suyog added a subscriber: Unknown Object (MLST).
silvas added a subscriber: silvas.Jul 22 2014, 10:40 AM

Hi Suyog,

In the future, if it's not too much trouble, could you please include a link like http://rise4fun.com/Z3/Evslo along with any identities just to verify that no errors are slipping through? It's an easy way to save the reviewer some head scratching and increase confidence in correctness.

Z3 is pretty easy to use and has a good tutorial http://rise4fun.com/Z3/tutorial/guide . You don't need to read all of it, just skip to the "bit vectors" section for the list of operations and just reuse the boilerplate in my link. Basically, if your identity is "foo == bar", then what you ask Z3 to do is check that the statement "foo != bar" is unsatisfiable. The online Z3 "permalink" feature is what gives you a URL like the above.

(The lisp syntax is kind of annoying, but it's workable; they used to have a Python version that was more syntactically convenient, but I can't seem to find it)

This revision is now accepted and ready to land.Jul 22 2014, 11:27 AM
suyog closed this revision.Jul 22 2014, 11:39 AM
suyog updated this revision to Diff 11771.

Closed by commit rL213677 (authored by @suyog).