[X86][AVX] Fold extract_subvector(splat, c) -> extract_subvector(splat, 0)
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Sun, 7 Feb 2021 11:41:43 +0000 (11:41 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Sun, 7 Feb 2021 11:42:41 +0000 (11:42 +0000)
commit598ceb25d4a42b6a814b2acc5e7ce5c73d6b8fb7
treed0a27572dc8f0e652d2dec0a2f90b189a138c30a
parent853c52c988d4ef56b0f7e02819d1976262b6ab0a
[X86][AVX] Fold extract_subvector(splat, c) -> extract_subvector(splat, 0)

We already do this for VBROADCASTs, extend this for any splat that SelectionDAG::isSplatValue recognises as well.
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/test/CodeGen/X86/vector-fshl-256.ll
llvm/test/CodeGen/X86/vector-fshr-256.ll
llvm/test/CodeGen/X86/vector-fshr-rot-256.ll
llvm/test/CodeGen/X86/vector-rotate-512.ll