[X86][AVX] Fold extract_subvector(VSRLI/VSHLI(x,32)) -> VSRLI/VSHLI(extract_subvector...
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Wed, 20 Jan 2021 14:19:18 +0000 (14:19 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Wed, 20 Jan 2021 14:34:54 +0000 (14:34 +0000)
commit19d02842ee56089b9208875ce4582e113e08fb6d
treeb2c1b584f78de42a36014102cbbb8519b7c9d573
parentc056f824340ff0189f3ef7870b83e3730de401d1
[X86][AVX] Fold extract_subvector(VSRLI/VSHLI(x,32)) -> VSRLI/VSHLI(extract_subvector(x),32)

As discussed on D56387, if we're shifting to extract the upper/lower half of a vXi64 vector then we're actually better off performing this at the subvector level as its very likely to fold into something.

combineConcatVectorOps can perform this in reverse if necessary.
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/test/CodeGen/X86/combine-sra.ll
llvm/test/CodeGen/X86/pmul.ll
llvm/test/CodeGen/X86/vec-strict-inttofp-256.ll