[LLVMdev] Auto-vectorization and phi nodes

Nadav Rotem nrotem at apple.com
Tue Feb 19 10:16:48 PST 2013



On Feb 19, 2013, at 10:09 AM, Vesa Norilo <vnorilo at siba.fi> wrote:

> Hi Nadav and Hal and thanks for the help!
> 
> To the best of my understanding, indvars doesn't complain and an induction variable is detected. However, the loop vectorizer says:
> 
> LV: Checking a loop in "add_vector"
> LV: Found a loop: Loop
> LV: Found an induction variable.
> LV: Found an unidentified PHI.  %a.ptr = phi float* [ %a, %Top ], [ %a.next, %Loop ]
> LV: Can't vectorize the instructions or CFG
> LV: Not vectorizing.
> 

Yes. SCEV does not identify this PHI. You can add a breakpoint in "isInductionVariable" to verify this.  How are you generating this code ? Do you have a  C example for it ?

Thanks,
Nadav





More information about the llvm-dev mailing list