[llvm] [IPO] Prevent removal of some convergent attr (PR #134863)

Nathan Gauër via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 9 06:35:50 PDT 2025


================
@@ -1967,7 +1980,9 @@ static void inferConvergent(const SCCNodeSet &SCCNodes,
   AI.registerAttrInference(AttributeInferer::InferenceDescriptor{
       Attribute::Convergent,
       // Skip non-convergent functions.
-      [](const Function &F) { return !F.isConvergent(); },
+      [](const Function &F) {
+        return !F.isConvergent() || FunctionRequiresConvergence(F);
+      },
----------------
Keenuts wrote:

Looks like the pass is running bottom-up, so if we drop convergence intrinsics in the callee, then we should technically be able to strip the control tokens in the caller. But this would go beyond the scope of this pass no?

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


More information about the llvm-commits mailing list