[X86][SSE] combineSetCCMOVMSK - allow comparison with upper (known zero) bits in...
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Tue, 13 Apr 2021 14:54:40 +0000 (15:54 +0100)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Tue, 13 Apr 2021 16:37:24 +0000 (17:37 +0100)
commit74f98391a7a42eccd7aa96546892cb9b65a39edb
treef5a42ba1dff268670c705f7dc03aa290436c322b
parent62328f2f29b432dadbd327ff91ba3914c478e3fc
[X86][SSE] combineSetCCMOVMSK - allow comparison with upper (known zero) bits in CMP(MOVMSK(PACKSS())) -> CMP(MOVMSK()) fold

We already allow the comparison of the upper bits of 'IsAllOf' (allbits) patterns, but we can safely compare the known zero bits for 'IsAnyOf' (zerobits) patterns as well.

This fixes an issues where we are comparing a type wide than the number of vector elements, which avoids a regression mentioned in rGbaadbe04bf75.
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/test/CodeGen/X86/vector-compare-all_of.ll
llvm/test/CodeGen/X86/vector-compare-any_of.ll