[Mlir-commits] [mlir] [mlir][rocdl] Add IR examples to OP definitions (PR #182147)
Krzysztof Drewniak
llvmlistbot at llvm.org
Wed Feb 18 17:13:13 PST 2026
================
@@ -2334,6 +2905,12 @@ class ROCDL_Math_IntrOp<string mnemonic, list<Trait> traits = [Pure]> :
Use this ROCDL-specific operation only when you fully understand its implication and
when it is strictly necessary. This op is usually chosen when a small loss in precision is
acceptable in exchange for higher execution speed.
+
+ Example:
+ ```mlir
+ // Scalar math operation.
+ %0 = rocdl.tanh %a f32 -> f32
----------------
krzysz00 wrote:
... As a note, you can use `# mnemontic #` syntax to substitute in the actual name of the operation here. End the string after `rocdl.`, add in the mnemonic, and then resumet the string.
https://github.com/llvm/llvm-project/pull/182147
More information about the Mlir-commits
mailing list