On Mon, Oct 28, 2024 at 9:35 AM Kugan Vivekanandarajah <kvivekana...@nvidia.com> wrote: > > Hi, > > When ifcvt version a loop, it sets dont_vectorize to the scalar loop. If the > vector loop is not vectorized and removed, the scalar loop is still left with > dont_vectorize. As a result, BB vectorization will not happen. > > This patch adds a new attribute called dont_loop_vectorize (that is different > from general dont_vectorize) specifically for loops versioned. BB > vectorization > does not need to honour this and still can vectorize. > > Bootstrapped and regression tested on aarch64-linux-gnu with no new > regressions. > > Is this OK?
I believe if-conversion never versions a loop that has ->dont_vectorize set so when the vectorizer elides the .LOOP_VECTORIZED test it can simply clear the flag again. I don't like adding a new flag, instead if the above doesn't work, the vectorizer should be changed how it identifies loop candidates, not relying on this flag. Richard. > Thanks, > Kugan >