[LLVMdev] Extracting a splat value from vector instruction.

Hal Finkel hfinkel at anl.gov
Thu Jul 9 17:23:12 PDT 2015


----- Original Message -----
> From: "Elena Demikhovsky" <elena.demikhovsky at intel.com>
> To: llvmdev at cs.uiuc.edu
> Sent: Thursday, July 9, 2015 7:10:48 AM
> Subject: [LLVMdev] Extracting a splat value from vector instruction.
> 
> 
> 
> 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?

It does sound useful, but I think you might as well put it in include/llvm/Analysis/VectorUtils.h as a static helper function. I don't think we need a new artificial subclass just for this functionality.

 -Hal

> 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.
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
> 

-- 
Hal Finkel
Assistant Computational Scientist
Leadership Computing Facility
Argonne National Laboratory




More information about the llvm-dev mailing list