This is an archive of the discontinued LLVM Phabricator instance.

[InstCombine] Add missing commute handling to (A | B) & (B ^ (~A)) -> (A & B)
ClosedPublic

Authored by craig.topper on Apr 24 2017, 11:43 PM.

Details

Summary

The matching here wasn't able to handle all the possible commutes. It always assumed the not would be on the left of the xor, but that's not guaranteed.

Diff Detail

Repository
rL LLVM

Event Timeline

craig.topper created this revision.Apr 24 2017, 11:43 PM
spatel accepted this revision.Apr 25 2017, 7:02 AM

LGTM.

This revision is now accepted and ready to land.Apr 25 2017, 7:02 AM
This revision was automatically updated to reflect the committed changes.