[X86] combinePredicateReduction - ensure non-i8 scalar type is a multiple of 8 bits
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Wed, 11 Jan 2023 14:19:23 +0000 (14:19 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Wed, 11 Jan 2023 14:19:33 +0000 (14:19 +0000)
commit7c2f0dc97036f1b2ed1db68d56019e737d420633
tree88082bf35099b6df24e5586333f6ec12d6c8eee8
parenteae26b6640afff715172d75fdee02e7df7530a9b
[X86] combinePredicateReduction - ensure non-i8 scalar type is a multiple of 8 bits

For the "all_of(setcc(x,y,eq)) -> PMOVMSKB(PCMPEQB())" fold, we failed to ensure that we could safely bitcast to <X x i8>, which in particular failed with boolean types

Thanks to @lerno for catching this and providing the test case
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/test/CodeGen/X86/vector-reduce-and-bool.ll