Add the last part that is needed for vectorization of if-converted code.
authorNadav Rotem <nrotem@apple.com>
Tue, 4 Dec 2012 06:15:11 +0000 (06:15 +0000)
committerNadav Rotem <nrotem@apple.com>
Tue, 4 Dec 2012 06:15:11 +0000 (06:15 +0000)
commit628c2dba60ea6978ba9aa9292c8a7e2064cbd0ef
tree4b81eaae4c379e98a7338d7053c8e2c8bd731e63
parent9b65726d24834f3c71bbbdc6cbd63c51d1527ed4
Add the last part that is needed for vectorization of if-converted code.
Added the code that actually performs the if-conversion during vectorization.

We can now vectorize this code:

for (int i=0; i<n; ++i) {
  unsigned k = 0;

  if (a[i] > b[i])   <------ IF inside the loop.
    k = k * 5 + 3;

  a[i] = k;          <---- K is a phi node that becomes vector-select.
}

llvm-svn: 169217
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
llvm/test/Transforms/LoopVectorize/if-conversion.ll [new file with mode: 0644]