[llvm-dev] LoopVectorizer with ifconversion

Jonas Paulsson via llvm-dev llvm-dev at lists.llvm.org
Tue Mar 21 02:11:57 PDT 2017


>> I think this extra cost should be added to the compare, but I am not 
>> sure if it would be better to instead add it to the branch, because 
>> there are also cases of e.g. (AND (COMPARE, COMPARE)). Adding a cost 
>> to a vectorized branch instead could be done by assuming that a 
>> conditional branch would have to be set up for each branch after the 
>> vector compare.
>
> Yes, I'd assume that you'd want to add some relative cost of a 
> compare, extract, and a correctly-predicted branch (etc.).
>
>>
>> Does the loop vectorizer know which blocks that need predication in 
>> the scalar loop will remain after vectorization? SystemZ could check 
>> such blocks by looking for stores, but that seems like extra work.
>
> Yes. Legal->blockNeedsPredication (there's also 
> Legal->isScalarWithPredication).
>
>  -Hal
>

Thanks Hal and and Matt.

I put up my current patch based on this discussion at 
https://reviews.llvm.org/D31175.

/Jonas



More information about the llvm-dev mailing list