[llvm] [Convergence] Extend cycles to include outside uses of tokens (PR #98006)
Sameer Sahasrabuddhe via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 9 22:45:16 PDT 2024
ssahasra wrote:
> Can you explain a bit more about the big picture?
Sure. I have also added a new note to the cpp, paraphrasing most of the answers.
> It looks like the new pass modifies the IR by adding some dummy branches which a pass like jump threading could easily remove again. So, after running the new pass, can you really rely on the IR remaining in "extended cycle" form for very long?
It's not clear yet whether this extended cycle can be preserved, and also whether existing transforms should be modified to preserve it if they can. I would like to believe that all transforms should be made aware of token semantics, but that by itself is not sufficient to answer this question.
> What effect do the dummy branches have on final codegen?
That's what we want to find out. This transform will first be used just before the structurizer, so that we can implement tokens end-to-end on AMDGPU. We may eventually use it with the wave transform, or possibly incorporate it into the wave transform.
> Why implement this by modifying the IR, instead of providing an analysis that reports the extended form of cycles on unmodified IR?
Because CodeGen. Also, in the big picture, an analysis will be the right choice if we decide to teach every transform about extended cycles. Otherwise, encoding the cycle extension into the CFG itself (provided it can or should be preserved) allows all the transforms (such as loop unrolling) to just continue doing what they do.
https://github.com/llvm/llvm-project/pull/98006
More information about the llvm-commits
mailing list