Add an early combine to match patterns such as:
(i16 bitcast (v16i1 x)) -> (i16 movmsk (v16i8 sext (v16i1 x)))
This combine needs to happen early enough before
type-legalization scalarizes the result of the setcc.
Paths
| Differential D33311
[X86] Match bitcast of vxi1 to pmovmsk ClosedPublic Authored by zvi on May 18 2017, 12:33 AM.
Details Summary Add an early combine to match patterns such as: (i16 bitcast (v16i1 x)) -> (i16 movmsk (v16i8 sext (v16i1 x))) This combine needs to happen early enough before
Diff Detail
Event TimelineThis revision is now accepted and ready to land.May 18 2017, 5:32 AM Comment Actions Why don't you use MOVMSKPD/MOVMSKPS for the 32/64 bit cases and avoid the vector truncation? Comment Actions
That's a good point. thanks! Comment Actions Thanks, Simon, for reminding me that the integer and FP MOVMSK operations are assymetrical, so we get more types covered without having to shuffle.
Comment Actions Generalize combine to match (ix bitcast (vxi1 t)) where t is not necessarily a setcc. zvi retitled this revision from [X86] Match bitcast of vsetcc to pmovmsk to [X86] Match bitcast of vxi1 to pmovmsk.May 29 2017, 10:54 PM Comment Actions LGTM with one minor - thanks.
Closed by commit rL304406: [X86] Match bitcast of vxi1 to pmovmsk (authored by zvi). · Explain WhyJun 1 2017, 4:28 AM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 101007 llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
llvm/trunk/test/CodeGen/X86/bitcast-and-setcc-128.ll
llvm/trunk/test/CodeGen/X86/bitcast-and-setcc-256.ll
llvm/trunk/test/CodeGen/X86/bitcast-setcc-128.ll
llvm/trunk/test/CodeGen/X86/bitcast-setcc-256.ll
llvm/trunk/test/CodeGen/X86/setcc-lowering.ll
|