This is an archive of the discontinued LLVM Phabricator instance.

[InstCombine][NFC]: Add tests: foldSelectICmpAndAnd(): and is commutative
ClosedPublic

Authored by lebedev.ri on Apr 11 2018, 3:22 PM.

Details

Summary

The fold added in D45108 did not account for the fact that
the and instruction is commutative, and if the mask is a variable,
the mask variable and the fold variable may be swapped.

I have noticed this by accident when looking into PR6773

Diff Detail

Repository
rL LLVM

Event Timeline

spatel accepted this revision.Apr 11 2018, 4:02 PM

LGTM. I think you have a good understanding of how to write/check instcombine tests, so feel free to add those as needed without pre-commit review unless you're not sure about something.

This revision is now accepted and ready to land.Apr 11 2018, 4:02 PM
This revision was automatically updated to reflect the committed changes.