Hi Richard, Thanks for the review. > On 28 Oct 2024, at 9:18 pm, Richard Biener <richard.guent...@gmail.com> wrote: > > External email: Use caution opening links or attachments > > > 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.
Here is a version where I am resetting dont_vectorize while folding ffold_loop_internal_call with false. Bootstrapped and regression tested on aarch64-linux-gnu. Is this OK? Thanks, Kugan > > Richard. > >> Thanks, >> Kugan >>
0001-PATCH-Fix-SLP-when-ifcvt-versioned-loop-is-not-vecto_v2.patch
Description: 0001-PATCH-Fix-SLP-when-ifcvt-versioned-loop-is-not-vecto_v2.patch