[all-commits] [llvm/llvm-project] df0a2b: [DAG] SelectionDAG::isSplatValue - add initial BIT...

Simon Pilgrim via All-commits all-commits at lists.llvm.org
Wed Mar 2 03:26:07 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: df0a2b4f309a2ea6a3038526722ac648d4678d47
      https://github.com/llvm/llvm-project/commit/df0a2b4f309a2ea6a3038526722ac648d4678d47
  Author: Simon Pilgrim <llvm-dev at redking.me.uk>
  Date:   2022-03-02 (Wed, 02 Mar 2022)

  Changed paths:
    M llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
    M llvm/test/CodeGen/X86/pr15296.ll
    M llvm/test/CodeGen/X86/vector-fshl-128.ll
    M llvm/test/CodeGen/X86/vector-fshl-rot-128.ll
    M llvm/test/CodeGen/X86/vector-fshr-128.ll
    M llvm/test/CodeGen/X86/vector-fshr-rot-128.ll
    M llvm/test/CodeGen/X86/vector-rotate-128.ll

  Log Message:
  -----------
  [DAG] SelectionDAG::isSplatValue - add initial BITCAST handling

This patch adds support for recognising vector splats by peeking through bitcasts to vectors with smaller element types - if all the offset subelements are splats then the bitcasted vector is a splat as well.

We don't have great coverage for isSplatValue so I've made this pretty specific to the use case I'm trying to fix - regressions in some vXi64 vector shift by splat cases that 32-bit x86 doesn't recognise because the shift amount buildvector has been type legalised to v2Xi32.

We can add further support (floats, bitcast from larger element types, undef elements) when we have actual test coverage.

Differential Revision: https://reviews.llvm.org/D120553




More information about the All-commits mailing list