[llvm-dev] ShuffleKind SK_ExtractSubvector

Friedman, Eli via llvm-dev llvm-dev at lists.llvm.org
Wed Feb 8 10:10:47 PST 2017


On 2/8/2017 6:35 AM, Jonas Paulsson via llvm-dev wrote:
> Hi,
>
> I am a little unsure about the semantics of the ShuffleKind 
> SK_ExtractSubvector. It seems a subvector is to be extracted, starting 
> from a given index of a given subtype.
>
> First of all, if index 0 is passed, I suppose this would mean a noop?
>
> But what about calls like the one made of LoopVectorizer for 
> Instruction::PHI in getInstructionCost():
>
> return TTI.getShuffleCost(TargetTransformInfo::SK_ExtractSubvector,
>                          VectorTy, VF - 1, VectorTy);
>
> Here the highest index is passed, which doesn't make sense to me. Nor 
> does it make sense to pass the the same VectorTy in both parameters.
>
> In BBVectorize, start index 0 is passed in one place, but then in 
> another place start index of 'VF' is passed, which should even be 
> outside possible indexes, or?
>
> I guess this is confusing since there are those extra parameters and 
> everything, but in the end it seems to me there is no code anywhere 
> checking this particular ShuffleKind, or?

I think the intent is to match the rules for EXTRACT_SUBVECTOR in isel 
(hence the name).  But, as you've noted, no in-tree targets are actually 
using it, so we can redefine it to use whatever definition is convenient.

-Eli

-- 
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project



More information about the llvm-dev mailing list