[X86][SSE] Canonicalize UNARYSHUFFLE(XOR(X,-1) -> XOR(UNARYSHUFFLE(X),-1)
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Thu, 30 Apr 2020 17:45:30 +0000 (18:45 +0100)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Thu, 30 Apr 2020 18:18:51 +0000 (19:18 +0100)
commitbf468f4349071f28755ca7ea7a53f21fc8c8ddbf
treefb180227c746036409dd2e90bc0f146269d0e892
parent2cf93ef9fe1df61b2aac97dc3320a12386a7dab5
[X86][SSE] Canonicalize UNARYSHUFFLE(XOR(X,-1) -> XOR(UNARYSHUFFLE(X),-1)

This pushes the NOT pattern up the DAG to help expose it for further combines (AND->ANDN in particular).

The PSHUFD/MOVDDUP 'splat' cases are the only ones I've seen in the wild so far, we can further generalize if/when we need to.
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/test/CodeGen/X86/avx512-vec-cmp.ll
llvm/test/CodeGen/X86/combine-bitselect.ll