[llvm] [amdgpu] Add llvm.amdgcn.init.whole.wave intrinsic (PR #105822)

Nicolai Hähnle via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 2 01:38:31 PDT 2024


nhaehnle wrote:

> > Can this replacea llvm.amdgcn.init.exec? (Sorry if that's a dumb question, I have not grokked your new intrinsic yet.)
> 
> In theory, no, but I guess it depends on what use cases it actually has in practice. init.exec can take any exec mask, and I think it can exist anywhere in the function (the comment only says it gets moved to the beginning of the basic block, but it doesn't say it has to be the entry block). OTOH init.whole.wave should only appear in the entry block (maybe I could add a Verifier check for that if you think it's worth having) and enables all the lanes.

I think it could replace `init.exec`. init.exec is also supposed to appear in the entry block,and the statement about it being moved up is really a requirement for this new intrinsic as well -- we want to be robust against intermediate transforms adding something above the intrinsic, perhaps because they added an `alloca` or something.

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


More information about the llvm-commits mailing list