[llvm-dev] Query on unswitching + vectorization

Friedman, Eli via llvm-dev llvm-dev at lists.llvm.org
Mon May 14 14:47:35 PDT 2018


On 5/14/2018 2:21 AM, Gopalasubramanian, Ganesh wrote:
>
>   * Looks like some sort of pass ordering issue; it will vectorize if
>     indvars runs sometime between loop unswitch and the vectorizer.
>
> That insight is helpful. I scheduled Canonicalization of induction 
> variable before loop vectorization and could get the loop vectorized.
>
> The indvars are heavily dependent on SCEV. If there a scalar like tmp 
> which is of real type, we may not be able to get the indvars sorted 
> out because of the integer type limitation in SCEV!
>
> Is there a way out when we have a scalar float computation that is 
> dependent on induction variable?
>

In general, a loop can't be vectorized if there's a PHI node; a scalar 
dependency means the iterations have to run in order.  But there are 
some special cases for reductions and induction variables.  For the LLVM 
loop vectorizer, see LoopVectorizationLegality::canVectorizeInstrs.

-Eli

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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180514/e34dc177/attachment.html>


More information about the llvm-dev mailing list