Page MenuHomePhabricator

[X86] Don't combine (x86cmp (trunc (movmsk (bitcast X))), 0) if the truncate discards bits.
ClosedPublic

Authored by craig.topper on Fri, Nov 19, 7:11 PM.

Details

Summary

We have transform that tries turn a pmovmskb into movmskps/pd or
movmskps to movmskpd. This transform isn't valid if the truncate
discarded bits that might be set by the original movmsk.

We could fix this by inserting an AND after the new movmsk to discard
the equivalent of the truncated bits, but I've left that for later
patch.

Fixes PR52567.

Diff Detail

Event Timeline

craig.topper created this revision.Fri, Nov 19, 7:11 PM
craig.topper requested review of this revision.Fri, Nov 19, 7:12 PM
Herald added a project: Restricted Project. · View Herald TranscriptFri, Nov 19, 7:12 PM
pengfei accepted this revision.Fri, Nov 19, 7:51 PM

LGTM.

This revision is now accepted and ready to land.Fri, Nov 19, 7:51 PM
This revision was landed with ongoing or failed builds.Fri, Nov 19, 9:51 PM
This revision was automatically updated to reflect the committed changes.

Nice catch!