[PATCH] D55426: [SelectionDAG] Add a generic isSplatValue function.

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 7 04:43:52 PST 2018


RKSimon created this revision.
RKSimon added reviewers: spatel, efriedma, craig.topper, atanasyan, lebedev.ri, andreadb.
Herald added subscribers: jrtc27, sdardis.

This patch introduces a generic function to determine whether a given vector type is known to be a splat value for the specified demanded elements, recursing up the DAG looking for BUILD_VECTOR or VECTOR_SHUFFLE splat patterns.

It also keeps track of the elements that are known to be UNDEF - it returns true if all the demanded elements are UNDEF (as this may be useful under some circumstances), so this needs to be handled by the caller.

A wrapper variant is also provided that doesn't take the DemandedElts or UndefElts arguments for cases where we just want to know if the SDValue is a splat or not (with/without UNDEFS).

I had hoped to completely remove the X86 local version of this function, but I'm seeing some regressions in shift/rotate codegen that will take a little longer to fix and I hope to get this in sooner so I can continue work on PR38243 which needs more capable splat detection.


Repository:
  rL LLVM

https://reviews.llvm.org/D55426

Files:
  include/llvm/CodeGen/SelectionDAG.h
  lib/CodeGen/SelectionDAG/SelectionDAG.cpp
  lib/Target/Mips/MipsSEISelLowering.cpp
  lib/Target/X86/X86ISelLowering.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D55426.177179.patch
Type: text/x-patch
Size: 9384 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181207/db293f41/attachment.bin>


More information about the llvm-commits mailing list