Page MenuHomePhabricator

[x86, SSE] fold 'isPositive' vector integer operations (PR26701)

Authored by spatel on Feb 25 2016, 5:32 PM.



This is one of the cases shown in:

Shift and negate is what InstCombine appears to prefer, so I've started with that pattern. Note that the 'pcmpeq' instructions are always generating the negative one for the actual 'pcmpgt' comparison in each case.

Diff Detail

Event Timeline

spatel updated this revision to Diff 49129.Feb 25 2016, 5:32 PM
spatel retitled this revision from to [x86, SSE] fold 'isPositive' vector integer operations (PR26701).
spatel updated this object.
spatel added reviewers: ab, delena, RKSimon.
spatel added a subscriber: llvm-commits.
ab accepted this revision.Feb 25 2016, 5:56 PM
ab edited edge metadata.



Could this miss something crazy like v128i1, or v1i128?

This revision is now accepted and ready to land.Feb 25 2016, 5:56 PM
spatel added inline comments.Feb 26 2016, 7:39 AM

Nice catch. Yes, that will fail horribly for an unsupported type. I'll enumerate the types that we can handle instead. I'll also add a comment about why we do this before type legalization: the pattern is obscured by bitcasts and other stuff after legalization.

This revision was automatically updated to reflect the committed changes.