New interface function is added to VectorUtils
authorElena Demikhovsky <elena.demikhovsky@intel.com>
Sun, 30 Aug 2015 07:28:18 +0000 (07:28 +0000)
committerElena Demikhovsky <elena.demikhovsky@intel.com>
Sun, 30 Aug 2015 07:28:18 +0000 (07:28 +0000)
commitd335656e0edcc7ba867a789ffd39f9e454b56487
treef6d79dc6c653a96250bdf37de2bf6007f2cc1020
parent19f4e17b6d75d9303eff4c5dcdeb3c5ed633417e
New interface function is added to VectorUtils
Value *getSplatValue(Value *Val);

It complements the CreateVectorSplat(), which creates 2 instructions - insertelement and shuffle with all-zero mask.

The new function recognizes the pattern - insertelement+shuffle and returns the splat value (or nullptr).
It also returns a splat value form ConstantDataVector, for completeness.

Differential Revision: http://reviews.llvm.org/D11124

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246371 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Analysis/VectorUtils.h
lib/Analysis/VectorUtils.cpp
lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp