This is an archive of the discontinued LLVM Phabricator instance.

[InstCombine][NFC] Add tests for variable mask canonicalization in masked merge
ClosedPublic

Authored by lebedev.ri on Apr 15 2018, 3:08 AM.

Details

Summary

Masked merge has a pattern of: ((x ^ y) & M) ^ y.
But, there is no difference between ((x ^ y) & M) ^ y and ((x ^ y) & ~M) ^ x,
We should canonicalize it and drop that xor.

Diff Detail

Repository
rL LLVM

Event Timeline

Add one more test file, with all the variations with inverted operands, deduplicated.
Originally generated with


While some of those aren't really a masked merge, they could be reduced further.

Revisit multi-use tests.

lebedev.ri accepted this revision.Apr 28 2018, 8:06 AM

Self-accepting since this is just a new tests, NFC, and the dependent differential is accepted.

This revision is now accepted and ready to land.Apr 28 2018, 8:06 AM
This revision was automatically updated to reflect the committed changes.