[LLVMdev] Extracting a splat value from vector instruction.

Demikhovsky, Elena elena.demikhovsky at intel.com
Thu Jul 9 05:10:48 PDT 2015


Hi,

We have a function in IRBuilder.h
Value *CreateVectorSplat(unsigned NumElts, Value *V, const Twine &Name = "") {
..
}

This function creates 2 instructions - "insertelement" and "shuffle" with all-zero mask.

Now I want to add
Value *getSplatValue(Value *Val). This function will try to recognize the pattern - insertelement+shuffle and return the splat value (or nullptr).
I suppose, this interface should be useful. Do you agree with me?

If yes, where should I put it? May it be I can define a new class VectorInst and put this interface there?
Thank you.


-        Elena



---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150709/ae8a5aca/attachment.html>


More information about the llvm-dev mailing list