[llvm] [LLVM][AMDGPU] AMDGPUInstCombineIntrinsic for *lane intrinsics (PR #99878)
Jay Foad via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 23 03:24:30 PDT 2024
jayfoad wrote:
> > > Pretty sure we do not want a UniformityAnalysis dependency in InstCombine.
> >
> > Why not? Because of compile time? Isn't UA supposed to be a no-op on targets that don't care about divergence?
>
> I had once proposed a TTI query to make UA a no-op on targets that don't care about it. That can solve a handful of really sticky issues, but people didn't like this extra dependence on TTI.
Nevertheless it was done: https://reviews.llvm.org/D151986
This makes the _uniformity_ analysis a no-op, but still runs the _cycle_ analysis.
> But currently, there is no formal framework to incrementally update UA when the program changes. So for targets that care about it, UA has to be recomputed on every change. Every time InstCombine changes an instruction, it will have to do one of three things:
>
> 1. Recompute UA, or
> 2. Prove that the unmodified UA is _safe_ after each iteration, were, "safe" means that no value is incorrectly marked uniform, or
> 3. Incrementally update UA.
>
> I think a combination of 2 and 3 is completely feasible, but needs careful work.
Good points. I had not thought about that. Does UA have a decent `verify()` implementation that could help to catch cases where it was not updated (or recomputed or invalidated etc) when it should have been?
https://github.com/llvm/llvm-project/pull/99878
More information about the llvm-commits
mailing list