[Mlir-commits] [mlir] [mlir] Added `Convergent` trait that matches LLVM's semantics (PR #152358)

Guray Ozen llvmlistbot at llvm.org
Thu Aug 7 06:25:32 PDT 2025


================
@@ -337,8 +337,12 @@ struct ReturnLike : public TraitBase<ConcreteType, ReturnLike> {
     return success();
   }
 };
-} // namespace OpTrait
 
+// The Operation may not be made control-dependent on any additional values.
+// See https://llvm.org/docs/ConvergentOperations.html for more details.
+template <typename ConcreteType>
+struct Convergent : public TraitBase<ConcreteType, Convergent> {};
----------------
grypp wrote:

> OtherwiseLLVM will apply optimizations incorrectly.

For each Op that MLIR generates, LLVM sets `convergency`. So LLVM won't do incorrect optimization for MLIR.


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


More information about the Mlir-commits mailing list