[llvm] [UniformityAnalysis] Track uniform values for conservative divergence queries (PR #180509)

Pankaj Dwivedi via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 2 07:50:29 PST 2026


================
@@ -392,7 +402,15 @@ template <typename ContextT> class GenericUniformityAnalysisImpl {
   };
 
   /// \brief Whether \p Val is divergent at its definition.
-  bool isDivergent(ConstValueRefT V) const { return DivergentValues.count(V); }
+  /// When UniformValues is populated (after finalization), values not in
+  /// either set (e.g. newly created) are conservatively treated as divergent.
+  bool isDivergent(ConstValueRefT V) const {
+    if (ContextT::isNeverDivergent(V))
+      return false;
+    if (UniformValues.empty())
----------------
PankajDwivedi-25 wrote:

I am not sure if we should do that in this patch?

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


More information about the llvm-commits mailing list