[PATCH] D146823: [GVN] Avoid replacing uniforms with non-uniforms in propagateEquality

Sameer Sahasrabuddhe via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 27 09:07:24 PDT 2023


sameerds added a comment.

In D146823#4224606 <https://reviews.llvm.org/D146823#4224606>, @bogner wrote:

> In D146823#4223630 <https://reviews.llvm.org/D146823#4223630>, @sameerds wrote:
>
>> When UA or DA initialize, they query TTI for sources of divergence. On a target with no divergence, they won't find any and hence the analysis should be trivial anyway. The only cost is one O(N) pass over the entire function. We could in principle eliminate that by just querying for TTI.hasBranchDivergence(). But there have been philosophical objections to taking that approach in the past. In general, one day, we would like to move to an implementation where source of divergence are inferred from IR semantics rather than TTI.
>
> The cost of UA will also include pulling in the cost of dependencies, so using UA here would also introduce the cost of at least CycleAnalysis. I don't think we can just dismiss the compile time concern for non-gpu targets without measuring it unfortunately.

Right. I had not thought of that. But then again, on the new pass manager, we can eliminate this cost by ensuring that CycleAnalysis is retrieved only if any divergence is found.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D146823/new/

https://reviews.llvm.org/D146823



More information about the llvm-commits mailing list