[llvm] [SLPVectorizer][AMDGPU] Look-through vectorization of AMDGPU intrinsics (PR #175821)

Alexey Bataev via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 31 03:28:14 PDT 2026


alexey-bataev wrote:

> > > @alexey-bataev The Look-through state is another sub-kind for target’s intrinsic call. The vectorized tree would otherwise be terminated by the target’s intrinsic call. Now the target’s intrinsic call is still the `NeedToGather` State, and `NeedToGather` of the target’s intrinsic call will be the root to try to build another vectorized tree.`NeedToGather` no longer marks the termination of the vectorized tree just because of the specific call. So do we need to consider introducing another state specifically for calls?
> > 
> > 
> > No, such nodes must serve as natural terminators of the trees and then as the roots of the new trees, they should not serve as the intermediate tree nodes
> 
> @alexey-bataev @mssefat @arsenm In this PR The target’s intrinsic call become a Look-through state node, it is already a kind of intermediate tree nodes. But the original support for targets' intrinsic call's vectorization in slp/loop-vectorization is InjectTLIMappings / VFDatabase .Why didn't we expand further in this direction? Why we need to find another way just only for amd backend. Alternatively, could we leverage look-through design to modify the vectorization support for the target-related intrinsics for all kind of target backend not only for amd?

You do not need to add new kind of nodes, Instead, just terminate the original tree vefore such nodes (it is done) and then build a new tree, starting from these nodes. These nodes must serve as roots for the new tree!

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


More information about the llvm-commits mailing list