(original) (raw)

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.

---------------------------------------------------------------------
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.