[llvm] [LoopIdiomVectorize] Recognize and transform minidx pattern (PR #144987)
Madhur Amilkanthwar via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 10 05:55:26 PDT 2025
madhur13490 wrote:
> > > @sjoerdmeijer See also some related discussion on #141556. My takeaway from that was that this really needs a GVN improvement first.
> >
> >
> > Hi @nikic As explained on the [discourse](https://discourse.llvm.org/t/vectorizing-min-max-reduction-pattern/85766) post, LLVM's GVN is not as sophisticated as GCC. LLVM's GVN is based on an older algorithm from the literature. Ideally, GVN should use both anticipated and available expressions, but it is currently not. Please see Thomas' thesis (https://www.cs.purdue.edu/homes/hosking/papers/vandrunen.pdf) which GCC implements. Having said this, GVN improvement would lead 10-15% improvement. Vectorization, this patch leads to 4x improvement. I see a clear winner and thus I'd like to see if we can progress this.
>
> It's my understanding that the GVN improvement brings this into a form that we can at least in principle vectorize, even if it doesn't work yet. It's not either/or, we want both.
I am not sure if that is the right understanding. @fhahn do you think GVN (with a lot of work) optimized IR would be vectorizable?
https://github.com/llvm/llvm-project/pull/144987
More information about the llvm-commits
mailing list