[llvm] [UniformityAnalysis] Skip CycleAnalysis on targets without branch divergence (PR #189948)

Pankaj Dwivedi via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 2 05:51:16 PDT 2026


================
@@ -1289,29 +1289,35 @@ GenericUniformityInfo<ContextT>::getFunction() const {
 }
 
 /// Whether \p V is divergent at its definition.
+/// A default-constructed instance (no analysis computed) reports everything
+/// as uniform, which is conservatively correct for non-divergent targets.
 template <typename ContextT>
 bool GenericUniformityInfo<ContextT>::isDivergent(ConstValueRefT V) const {
-  return DA->isDivergent(V);
+  return DA && DA->isDivergent(V);
----------------
PankajDwivedi-25 wrote:

You mean something as we did in this patch: https://github.com/llvm/llvm-project/pull/175167/changes.

I am fine with that as well. We may need to update the current use of uniformity in some places with this guard.

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


More information about the llvm-commits mailing list