[llvm] [LoopIdiomVectorize] Recognize and transform minidx pattern (PR #144987)

Madhur Amilkanthwar via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 10 03:56:49 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.

https://github.com/llvm/llvm-project/pull/144987


More information about the llvm-commits mailing list