CINXE.COM
'complex' Dialect - MLIR
<!doctype html><html lang=en-us><head><meta charset=utf-8><meta http-equiv=x-ua-compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"><title>'complex' Dialect - MLIR</title><meta name=description content="Multi-Level IR Compiler Framework"><meta name=generator content="Hugo 0.119.0"><link href=https://mlir.llvm.org/index.xml rel=alternate type=application/rss+xml><link rel=canonical href=https://mlir.llvm.org/docs/Dialects/ComplexOps/><link rel=stylesheet href=https://mlir.llvm.org/css/theme.css><script src=https://use.fontawesome.com/releases/v5.0.6/js/all.js></script> <link rel=stylesheet href=https://mlir.llvm.org/css/chroma.min.css><script src=https://cdn.jsdelivr.net/npm/jquery@3.3.1/dist/jquery.min.js></script> <script src=https://cdn.jsdelivr.net/npm/jquery.easing@1.4.1/jquery.easing.min.js></script> <script src=https://mlir.llvm.org/js/bundle.js></script> <script type=text/javascript src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script> <script type=text/x-mathjax-config> MathJax.Hub.Config({ tex2jax: { inlineMath: [['$', '$'] ], displayMath: [ ['$$','$$'], ["\\[","\\]"] ] } }); </script><link rel=apple-touch-icon sizes=180x180 href="/apple-touch-icon.png?v=1"><link rel=icon type=image/png sizes=32x32 href="/favicon-32x32.png?v=1"><link rel=icon type=image/png sizes=16x16 href="/favicon-16x16.png?v=1"><link rel=manifest href="/site.webmanifest?v=1"><link rel=mask-icon href="/safari-pinned-tab.svg?v=1" color=#3775e0><link rel="shortcut icon" href="/favicon.ico?v=1"><meta name=msapplication-TileColor content="#2d89ef"><meta name=theme-color content="#ffffff"><link rel=icon href=/favicon.svg type=image/svg+xml sizes=any><style>:root{}</style></head><body><div class=container><header><h1><div><img src=https://mlir.llvm.org//mlir-logo.png width=40px align=absmiddle> MLIR</div></h1><p class=description>Multi-Level IR Compiler Framework</p></header><div class=global-menu><nav><ul><li class=parent><a href>Community<i class="fas fa-angle-right"></i></a><ul class=sub-menu><li class=child><a href=https://llvm.discourse.group/c/mlir/31>Forums</a></li><li class=child><a href=https://discord.gg/xS7Z362>Chat</a></li></ul></li><li><a href=/getting_started/Debugging/>Debugging Tips</a></li><li><a href=/getting_started/Faq/>FAQ</a></li><li class=parent><a href=https://github.com/llvm/llvm-project/tree/main/mlir>Source<i class="fas fa-angle-right"></i></a><ul class=sub-menu><li class=child><a href=/doxygen/>Doxygen</a></li><li class=child><a href=https://github.com/llvm/llvm-project/tree/main/mlir>GitHub</a></li></ul></li><li><a href="https://bugs.llvm.org/buglist.cgi?bug_status=__open__&list_id=177877&order=changeddate%20DESC%2Cpriority%2Cbug_severity&product=MLIR&query_format=specific">Bugs</a></li><li><a href=https://github.com/llvm/mlir-www/tree/main/website/static/LogoAssets>Logo Assets</a></li><li><a href=https://www.youtube.com/MLIRCompiler>Youtube Channel</a></li></ul></nav></div><div class=content-container><main><h1>'complex' Dialect</h1><p>The complex dialect is intended to hold complex numbers creation and arithmetic ops.</p><p><nav id=TableOfContents><ul><li><a href=#operations>Operations</a><ul><li><a href=#complexabs-complexabsop><code>complex.abs</code> (complex::AbsOp)</a></li><li><a href=#complexadd-complexaddop><code>complex.add</code> (complex::AddOp)</a></li><li><a href=#complexangle-complexangleop><code>complex.angle</code> (complex::AngleOp)</a></li><li><a href=#complexatan2-complexatan2op><code>complex.atan2</code> (complex::Atan2Op)</a></li><li><a href=#complexbitcast-complexbitcastop><code>complex.bitcast</code> (complex::BitcastOp)</a></li><li><a href=#complexconj-complexconjop><code>complex.conj</code> (complex::ConjOp)</a></li><li><a href=#complexconstant-complexconstantop><code>complex.constant</code> (complex::ConstantOp)</a></li><li><a href=#complexcos-complexcosop><code>complex.cos</code> (complex::CosOp)</a></li><li><a href=#complexcreate-complexcreateop><code>complex.create</code> (complex::CreateOp)</a></li><li><a href=#complexdiv-complexdivop><code>complex.div</code> (complex::DivOp)</a></li><li><a href=#complexeq-complexequalop><code>complex.eq</code> (complex::EqualOp)</a></li><li><a href=#complexexp-complexexpop><code>complex.exp</code> (complex::ExpOp)</a></li><li><a href=#complexexpm1-complexexpm1op><code>complex.expm1</code> (complex::Expm1Op)</a></li><li><a href=#complexim-compleximop><code>complex.im</code> (complex::ImOp)</a></li><li><a href=#complexlog-complexlogop><code>complex.log</code> (complex::LogOp)</a></li><li><a href=#complexlog1p-complexlog1pop><code>complex.log1p</code> (complex::Log1pOp)</a></li><li><a href=#complexmul-complexmulop><code>complex.mul</code> (complex::MulOp)</a></li><li><a href=#complexneg-complexnegop><code>complex.neg</code> (complex::NegOp)</a></li><li><a href=#complexneq-complexnotequalop><code>complex.neq</code> (complex::NotEqualOp)</a></li><li><a href=#complexpow-complexpowop><code>complex.pow</code> (complex::PowOp)</a></li><li><a href=#complexre-complexreop><code>complex.re</code> (complex::ReOp)</a></li><li><a href=#complexrsqrt-complexrsqrtop><code>complex.rsqrt</code> (complex::RsqrtOp)</a></li><li><a href=#complexsign-complexsignop><code>complex.sign</code> (complex::SignOp)</a></li><li><a href=#complexsin-complexsinop><code>complex.sin</code> (complex::SinOp)</a></li><li><a href=#complexsqrt-complexsqrtop><code>complex.sqrt</code> (complex::SqrtOp)</a></li><li><a href=#complexsub-complexsubop><code>complex.sub</code> (complex::SubOp)</a></li><li><a href=#complextan-complextanop><code>complex.tan</code> (complex::TanOp)</a></li><li><a href=#complextanh-complextanhop><code>complex.tanh</code> (complex::TanhOp)</a></li></ul></li><li><a href=#enums>Enums</a><ul><li><a href=#cmpfpredicate>CmpFPredicate</a></li><li><a href=#cmpipredicate>CmpIPredicate</a></li><li><a href=#integeroverflowflags>IntegerOverflowFlags</a></li><li><a href=#roundingmode>RoundingMode</a></li><li><a href=#atomicrmwkind>AtomicRMWKind</a></li><li><a href=#fastmathflags>FastMathFlags</a></li></ul></li></ul></nav><h2 id=operations>Operations <a class=headline-hash href=#operations>¶</a></h2><p><a href=https://github.com/llvm/llvm-project/blob/main/mlir/include/mlir/Dialect/Complex/IR/ComplexOps.td>source</a></p><h3 id=complexabs-complexabsop><code>complex.abs</code> (complex::AbsOp) <a class=headline-hash href=#complexabs-complexabsop>¶</a></h3><p><em>Computes absolute value of a complex number</em></p><p>Syntax:</p><pre tabindex=0><code>operation ::= `complex.abs` $complex (`fastmath` `` $fastmath^)? attr-dict `:` type($complex) </code></pre><p>The <code>abs</code> op takes a single complex number and computes its absolute value.</p><p>Example:</p><div class=highlight><pre tabindex=0 class=chroma><code class=language-mlir data-lang=mlir><span class=line><span class=cl><span class=nv>%a</span> <span class=p>=</span> complex<span class=p>.</span>abs <span class=nv>%b</span> <span class=p>:</span> complex<span class=p><</span><span class=k>f32</span><span class=p>></span> </span></span></code></pre></div><p>Traits: <code>AlwaysSpeculatableImplTrait</code>, <code>Elementwise</code></p><p>Interfaces: <code>ArithFastMathInterface</code>, <code>ConditionallySpeculatable</code>, <code>InferTypeOpInterface</code>, <code>NoMemoryEffect (MemoryEffectOpInterface)</code></p><p>Effects: <code>MemoryEffects::Effect{}</code></p><h4 id=attributes>Attributes: <a class=headline-hash href=#attributes>¶</a></h4><table><tr><th>Attribute</th><th>MLIR Type</th><th>Description</th></tr><tr><td><code>fastmath</code></td><td>::mlir::arith::FastMathFlagsAttr</td><td><details><summary>Floating point fast math flags</summary><p>Enum cases:</p><ul><li>none (<code>none</code>)</li><li>reassoc (<code>reassoc</code>)</li><li>nnan (<code>nnan</code>)</li><li>ninf (<code>ninf</code>)</li><li>nsz (<code>nsz</code>)</li><li>arcp (<code>arcp</code>)</li><li>contract (<code>contract</code>)</li><li>afn (<code>afn</code>)</li><li>fast (<code>fast</code>)</li></ul></details></td></tr></table><h4 id=operands>Operands: <a class=headline-hash href=#operands>¶</a></h4><table><thead><tr><th style=text-align:center>Operand</th><th>Description</th></tr></thead><tbody><tr><td style=text-align:center><code>complex</code></td><td>complex type with floating-point elements</td></tr></tbody></table><h4 id=results>Results: <a class=headline-hash href=#results>¶</a></h4><table><thead><tr><th style=text-align:center>Result</th><th>Description</th></tr></thead><tbody><tr><td style=text-align:center><code>result</code></td><td>floating-point</td></tr></tbody></table><h3 id=complexadd-complexaddop><code>complex.add</code> (complex::AddOp) <a class=headline-hash href=#complexadd-complexaddop>¶</a></h3><p><em>Complex addition</em></p><p>Syntax:</p><pre tabindex=0><code>operation ::= `complex.add` $lhs `,` $rhs (`fastmath` `` $fastmath^)? attr-dict `:` type($result) </code></pre><p>The <code>add</code> operation takes two complex numbers and returns their sum.</p><p>Example:</p><div class=highlight><pre tabindex=0 class=chroma><code class=language-mlir data-lang=mlir><span class=line><span class=cl><span class=nv>%a</span> <span class=p>=</span> complex<span class=p>.</span>add <span class=nv>%b</span><span class=p>,</span> <span class=nv>%c</span> <span class=p>:</span> complex<span class=p><</span><span class=k>f32</span><span class=p>></span> </span></span></code></pre></div><p>Traits: <code>AlwaysSpeculatableImplTrait</code>, <code>Elementwise</code>, <code>SameOperandsAndResultType</code></p><p>Interfaces: <code>ArithFastMathInterface</code>, <code>ConditionallySpeculatable</code>, <code>InferTypeOpInterface</code>, <code>NoMemoryEffect (MemoryEffectOpInterface)</code></p><p>Effects: <code>MemoryEffects::Effect{}</code></p><h4 id=attributes-1>Attributes: <a class=headline-hash href=#attributes-1>¶</a></h4><table><tr><th>Attribute</th><th>MLIR Type</th><th>Description</th></tr><tr><td><code>fastmath</code></td><td>::mlir::arith::FastMathFlagsAttr</td><td><details><summary>Floating point fast math flags</summary><p>Enum cases:</p><ul><li>none (<code>none</code>)</li><li>reassoc (<code>reassoc</code>)</li><li>nnan (<code>nnan</code>)</li><li>ninf (<code>ninf</code>)</li><li>nsz (<code>nsz</code>)</li><li>arcp (<code>arcp</code>)</li><li>contract (<code>contract</code>)</li><li>afn (<code>afn</code>)</li><li>fast (<code>fast</code>)</li></ul></details></td></tr></table><h4 id=operands-1>Operands: <a class=headline-hash href=#operands-1>¶</a></h4><table><thead><tr><th style=text-align:center>Operand</th><th>Description</th></tr></thead><tbody><tr><td style=text-align:center><code>lhs</code></td><td>complex type with floating-point elements</td></tr><tr><td style=text-align:center><code>rhs</code></td><td>complex type with floating-point elements</td></tr></tbody></table><h4 id=results-1>Results: <a class=headline-hash href=#results-1>¶</a></h4><table><thead><tr><th style=text-align:center>Result</th><th>Description</th></tr></thead><tbody><tr><td style=text-align:center><code>result</code></td><td>complex type with floating-point elements</td></tr></tbody></table><h3 id=complexangle-complexangleop><code>complex.angle</code> (complex::AngleOp) <a class=headline-hash href=#complexangle-complexangleop>¶</a></h3><p><em>Computes argument value of a complex number</em></p><p>Syntax:</p><pre tabindex=0><code>operation ::= `complex.angle` $complex (`fastmath` `` $fastmath^)? attr-dict `:` type($complex) </code></pre><p>The <code>angle</code> op takes a single complex number and computes its argument value with a branch cut along the negative real axis.</p><p>Example:</p><div class=highlight><pre tabindex=0 class=chroma><code class=language-mlir data-lang=mlir><span class=line><span class=cl> <span class=nv>%a</span> <span class=p>=</span> complex<span class=p>.</span>angle <span class=nv>%b</span> <span class=p>:</span> complex<span class=p><</span><span class=k>f32</span><span class=p>></span> </span></span></code></pre></div><p>Traits: <code>AlwaysSpeculatableImplTrait</code>, <code>Elementwise</code></p><p>Interfaces: <code>ArithFastMathInterface</code>, <code>ConditionallySpeculatable</code>, <code>InferTypeOpInterface</code>, <code>NoMemoryEffect (MemoryEffectOpInterface)</code></p><p>Effects: <code>MemoryEffects::Effect{}</code></p><h4 id=attributes-2>Attributes: <a class=headline-hash href=#attributes-2>¶</a></h4><table><tr><th>Attribute</th><th>MLIR Type</th><th>Description</th></tr><tr><td><code>fastmath</code></td><td>::mlir::arith::FastMathFlagsAttr</td><td><details><summary>Floating point fast math flags</summary><p>Enum cases:</p><ul><li>none (<code>none</code>)</li><li>reassoc (<code>reassoc</code>)</li><li>nnan (<code>nnan</code>)</li><li>ninf (<code>ninf</code>)</li><li>nsz (<code>nsz</code>)</li><li>arcp (<code>arcp</code>)</li><li>contract (<code>contract</code>)</li><li>afn (<code>afn</code>)</li><li>fast (<code>fast</code>)</li></ul></details></td></tr></table><h4 id=operands-2>Operands: <a class=headline-hash href=#operands-2>¶</a></h4><table><thead><tr><th style=text-align:center>Operand</th><th>Description</th></tr></thead><tbody><tr><td style=text-align:center><code>complex</code></td><td>complex type with floating-point elements</td></tr></tbody></table><h4 id=results-2>Results: <a class=headline-hash href=#results-2>¶</a></h4><table><thead><tr><th style=text-align:center>Result</th><th>Description</th></tr></thead><tbody><tr><td style=text-align:center><code>result</code></td><td>floating-point</td></tr></tbody></table><h3 id=complexatan2-complexatan2op><code>complex.atan2</code> (complex::Atan2Op) <a class=headline-hash href=#complexatan2-complexatan2op>¶</a></h3><p><em>Complex 2-argument arctangent</em></p><p>Syntax:</p><pre tabindex=0><code>operation ::= `complex.atan2` $lhs `,` $rhs (`fastmath` `` $fastmath^)? attr-dict `:` type($result) </code></pre><p>For complex numbers it is expressed using complex logarithm atan2(y, x) = -i * log((x + i * y) / sqrt(x<strong>2 + y</strong>2))</p><p>Example:</p><div class=highlight><pre tabindex=0 class=chroma><code class=language-mlir data-lang=mlir><span class=line><span class=cl><span class=nv>%a</span> <span class=p>=</span> complex<span class=p>.</span>atan2 <span class=nv>%b</span><span class=p>,</span> <span class=nv>%c</span> <span class=p>:</span> complex<span class=p><</span><span class=k>f32</span><span class=p>></span> </span></span></code></pre></div><p>Traits: <code>AlwaysSpeculatableImplTrait</code>, <code>Elementwise</code>, <code>SameOperandsAndResultType</code></p><p>Interfaces: <code>ArithFastMathInterface</code>, <code>ConditionallySpeculatable</code>, <code>InferTypeOpInterface</code>, <code>NoMemoryEffect (MemoryEffectOpInterface)</code></p><p>Effects: <code>MemoryEffects::Effect{}</code></p><h4 id=attributes-3>Attributes: <a class=headline-hash href=#attributes-3>¶</a></h4><table><tr><th>Attribute</th><th>MLIR Type</th><th>Description</th></tr><tr><td><code>fastmath</code></td><td>::mlir::arith::FastMathFlagsAttr</td><td><details><summary>Floating point fast math flags</summary><p>Enum cases:</p><ul><li>none (<code>none</code>)</li><li>reassoc (<code>reassoc</code>)</li><li>nnan (<code>nnan</code>)</li><li>ninf (<code>ninf</code>)</li><li>nsz (<code>nsz</code>)</li><li>arcp (<code>arcp</code>)</li><li>contract (<code>contract</code>)</li><li>afn (<code>afn</code>)</li><li>fast (<code>fast</code>)</li></ul></details></td></tr></table><h4 id=operands-3>Operands: <a class=headline-hash href=#operands-3>¶</a></h4><table><thead><tr><th style=text-align:center>Operand</th><th>Description</th></tr></thead><tbody><tr><td style=text-align:center><code>lhs</code></td><td>complex type with floating-point elements</td></tr><tr><td style=text-align:center><code>rhs</code></td><td>complex type with floating-point elements</td></tr></tbody></table><h4 id=results-3>Results: <a class=headline-hash href=#results-3>¶</a></h4><table><thead><tr><th style=text-align:center>Result</th><th>Description</th></tr></thead><tbody><tr><td style=text-align:center><code>result</code></td><td>complex type with floating-point elements</td></tr></tbody></table><h3 id=complexbitcast-complexbitcastop><code>complex.bitcast</code> (complex::BitcastOp) <a class=headline-hash href=#complexbitcast-complexbitcastop>¶</a></h3><p><em>Computes bitcast between complex and equal arith types</em></p><p>Syntax:</p><pre tabindex=0><code>operation ::= `complex.bitcast` $operand attr-dict `:` type($operand) `to` type($result) </code></pre><p>Example:</p><div class=highlight><pre tabindex=0 class=chroma><code class=language-mlir data-lang=mlir><span class=line><span class=cl> <span class=nv>%a</span> <span class=p>=</span> complex<span class=p>.</span>bitcast <span class=nv>%b</span> <span class=p>:</span> complex<span class=p><</span><span class=k>f32</span><span class=p>></span> <span class=p>-></span> <span class=k>i64</span> </span></span></code></pre></div><p>Traits: <code>AlwaysSpeculatableImplTrait</code></p><p>Interfaces: <code>ConditionallySpeculatable</code>, <code>NoMemoryEffect (MemoryEffectOpInterface)</code></p><p>Effects: <code>MemoryEffects::Effect{}</code></p><h4 id=operands-4>Operands: <a class=headline-hash href=#operands-4>¶</a></h4><table><thead><tr><th style=text-align:center>Operand</th><th>Description</th></tr></thead><tbody><tr><td style=text-align:center><code>operand</code></td><td>any type</td></tr></tbody></table><h4 id=results-4>Results: <a class=headline-hash href=#results-4>¶</a></h4><table><thead><tr><th style=text-align:center>Result</th><th>Description</th></tr></thead><tbody><tr><td style=text-align:center><code>result</code></td><td>any type</td></tr></tbody></table><h3 id=complexconj-complexconjop><code>complex.conj</code> (complex::ConjOp) <a class=headline-hash href=#complexconj-complexconjop>¶</a></h3><p><em>Calculate the complex conjugate</em></p><p>Syntax:</p><pre tabindex=0><code>operation ::= `complex.conj` $complex (`fastmath` `` $fastmath^)? attr-dict `:` type($complex) </code></pre><p>The <code>conj</code> op takes a single complex number and computes the complex conjugate.</p><p>Example:</p><div class=highlight><pre tabindex=0 class=chroma><code class=language-mlir data-lang=mlir><span class=line><span class=cl><span class=nv>%a</span> <span class=p>=</span> complex<span class=p>.</span>conj <span class=nv>%b</span><span class=p>:</span> complex<span class=p><</span><span class=k>f32</span><span class=p>></span> </span></span></code></pre></div><p>Traits: <code>AlwaysSpeculatableImplTrait</code>, <code>Elementwise</code>, <code>SameOperandsAndResultType</code></p><p>Interfaces: <code>ArithFastMathInterface</code>, <code>ConditionallySpeculatable</code>, <code>InferTypeOpInterface</code>, <code>NoMemoryEffect (MemoryEffectOpInterface)</code></p><p>Effects: <code>MemoryEffects::Effect{}</code></p><h4 id=attributes-4>Attributes: <a class=headline-hash href=#attributes-4>¶</a></h4><table><tr><th>Attribute</th><th>MLIR Type</th><th>Description</th></tr><tr><td><code>fastmath</code></td><td>::mlir::arith::FastMathFlagsAttr</td><td><details><summary>Floating point fast math flags</summary><p>Enum cases:</p><ul><li>none (<code>none</code>)</li><li>reassoc (<code>reassoc</code>)</li><li>nnan (<code>nnan</code>)</li><li>ninf (<code>ninf</code>)</li><li>nsz (<code>nsz</code>)</li><li>arcp (<code>arcp</code>)</li><li>contract (<code>contract</code>)</li><li>afn (<code>afn</code>)</li><li>fast (<code>fast</code>)</li></ul></details></td></tr></table><h4 id=operands-5>Operands: <a class=headline-hash href=#operands-5>¶</a></h4><table><thead><tr><th style=text-align:center>Operand</th><th>Description</th></tr></thead><tbody><tr><td style=text-align:center><code>complex</code></td><td>complex type with floating-point elements</td></tr></tbody></table><h4 id=results-5>Results: <a class=headline-hash href=#results-5>¶</a></h4><table><thead><tr><th style=text-align:center>Result</th><th>Description</th></tr></thead><tbody><tr><td style=text-align:center><code>result</code></td><td>complex type with floating-point elements</td></tr></tbody></table><h3 id=complexconstant-complexconstantop><code>complex.constant</code> (complex::ConstantOp) <a class=headline-hash href=#complexconstant-complexconstantop>¶</a></h3><p><em>Complex number constant operation</em></p><p>Syntax:</p><pre tabindex=0><code>operation ::= `complex.constant` $value attr-dict `:` type($complex) </code></pre><p>The <code>complex.constant</code> operation creates a constant complex number from an attribute containing the real and imaginary parts.</p><p>Example:</p><div class=highlight><pre tabindex=0 class=chroma><code class=language-mlir data-lang=mlir><span class=line><span class=cl><span class=nv>%a</span> <span class=p>=</span> complex<span class=p>.</span><span class=kt>constant</span> <span class=p>[</span><span class=m>0.1</span><span class=p>,</span> <span class=m>-1.0</span><span class=p>]</span> <span class=p>:</span> complex<span class=p><</span><span class=k>f64</span><span class=p>></span> </span></span></code></pre></div><p>Traits: <code>AlwaysSpeculatableImplTrait</code>, <code>ConstantLike</code></p><p>Interfaces: <code>ConditionallySpeculatable</code>, <code>NoMemoryEffect (MemoryEffectOpInterface)</code>, <code>OpAsmOpInterface</code></p><p>Effects: <code>MemoryEffects::Effect{}</code></p><h4 id=attributes-5>Attributes: <a class=headline-hash href=#attributes-5>¶</a></h4><table><tr><th>Attribute</th><th>MLIR Type</th><th>Description</th></tr><tr><td><code>value</code></td><td>::mlir::ArrayAttr</td><td>array attribute</td></tr></table><h4 id=results-6>Results: <a class=headline-hash href=#results-6>¶</a></h4><table><thead><tr><th style=text-align:center>Result</th><th>Description</th></tr></thead><tbody><tr><td style=text-align:center><code>complex</code></td><td>complex-type</td></tr></tbody></table><h3 id=complexcos-complexcosop><code>complex.cos</code> (complex::CosOp) <a class=headline-hash href=#complexcos-complexcosop>¶</a></h3><p><em>Computes cosine of a complex number</em></p><p>Syntax:</p><pre tabindex=0><code>operation ::= `complex.cos` $complex (`fastmath` `` $fastmath^)? attr-dict `:` type($complex) </code></pre><p>The <code>cos</code> op takes a single complex number and computes the cosine of it, i.e. <code>cos(x)</code>, where <code>x</code> is the input value.</p><p>Example:</p><div class=highlight><pre tabindex=0 class=chroma><code class=language-mlir data-lang=mlir><span class=line><span class=cl><span class=nv>%a</span> <span class=p>=</span> complex<span class=p>.</span>cos <span class=nv>%b</span> <span class=p>:</span> complex<span class=p><</span><span class=k>f32</span><span class=p>></span> </span></span></code></pre></div><p>Traits: <code>AlwaysSpeculatableImplTrait</code>, <code>Elementwise</code>, <code>SameOperandsAndResultType</code></p><p>Interfaces: <code>ArithFastMathInterface</code>, <code>ConditionallySpeculatable</code>, <code>InferTypeOpInterface</code>, <code>NoMemoryEffect (MemoryEffectOpInterface)</code></p><p>Effects: <code>MemoryEffects::Effect{}</code></p><h4 id=attributes-6>Attributes: <a class=headline-hash href=#attributes-6>¶</a></h4><table><tr><th>Attribute</th><th>MLIR Type</th><th>Description</th></tr><tr><td><code>fastmath</code></td><td>::mlir::arith::FastMathFlagsAttr</td><td><details><summary>Floating point fast math flags</summary><p>Enum cases:</p><ul><li>none (<code>none</code>)</li><li>reassoc (<code>reassoc</code>)</li><li>nnan (<code>nnan</code>)</li><li>ninf (<code>ninf</code>)</li><li>nsz (<code>nsz</code>)</li><li>arcp (<code>arcp</code>)</li><li>contract (<code>contract</code>)</li><li>afn (<code>afn</code>)</li><li>fast (<code>fast</code>)</li></ul></details></td></tr></table><h4 id=operands-6>Operands: <a class=headline-hash href=#operands-6>¶</a></h4><table><thead><tr><th style=text-align:center>Operand</th><th>Description</th></tr></thead><tbody><tr><td style=text-align:center><code>complex</code></td><td>complex type with floating-point elements</td></tr></tbody></table><h4 id=results-7>Results: <a class=headline-hash href=#results-7>¶</a></h4><table><thead><tr><th style=text-align:center>Result</th><th>Description</th></tr></thead><tbody><tr><td style=text-align:center><code>result</code></td><td>complex type with floating-point elements</td></tr></tbody></table><h3 id=complexcreate-complexcreateop><code>complex.create</code> (complex::CreateOp) <a class=headline-hash href=#complexcreate-complexcreateop>¶</a></h3><p><em>Complex number creation operation</em></p><p>Syntax:</p><pre tabindex=0><code>operation ::= `complex.create` $real `,` $imaginary attr-dict `:` type($complex) </code></pre><p>The <code>complex.create</code> operation creates a complex number from two floating-point operands, the real and the imaginary part.</p><p>Example:</p><div class=highlight><pre tabindex=0 class=chroma><code class=language-mlir data-lang=mlir><span class=line><span class=cl><span class=nv>%a</span> <span class=p>=</span> complex<span class=p>.</span>create <span class=nv>%b</span><span class=p>,</span> <span class=nv>%c</span> <span class=p>:</span> complex<span class=p><</span><span class=k>f32</span><span class=p>></span> </span></span></code></pre></div><p>Traits: <code>AlwaysSpeculatableImplTrait</code></p><p>Interfaces: <code>ConditionallySpeculatable</code>, <code>NoMemoryEffect (MemoryEffectOpInterface)</code></p><p>Effects: <code>MemoryEffects::Effect{}</code></p><h4 id=operands-7>Operands: <a class=headline-hash href=#operands-7>¶</a></h4><table><thead><tr><th style=text-align:center>Operand</th><th>Description</th></tr></thead><tbody><tr><td style=text-align:center><code>real</code></td><td>floating-point</td></tr><tr><td style=text-align:center><code>imaginary</code></td><td>floating-point</td></tr></tbody></table><h4 id=results-8>Results: <a class=headline-hash href=#results-8>¶</a></h4><table><thead><tr><th style=text-align:center>Result</th><th>Description</th></tr></thead><tbody><tr><td style=text-align:center><code>complex</code></td><td>complex type with floating-point elements</td></tr></tbody></table><h3 id=complexdiv-complexdivop><code>complex.div</code> (complex::DivOp) <a class=headline-hash href=#complexdiv-complexdivop>¶</a></h3><p><em>Complex division</em></p><p>Syntax:</p><pre tabindex=0><code>operation ::= `complex.div` $lhs `,` $rhs (`fastmath` `` $fastmath^)? attr-dict `:` type($result) </code></pre><p>The <code>div</code> operation takes two complex numbers and returns result of their division:</p><div class=highlight><pre tabindex=0 class=chroma><code class=language-mlir data-lang=mlir><span class=line><span class=cl><span class=nv>%a</span> <span class=p>=</span> complex<span class=p>.</span>div <span class=nv>%b</span><span class=p>,</span> <span class=nv>%c</span> <span class=p>:</span> complex<span class=p><</span><span class=k>f32</span><span class=p>></span> </span></span></code></pre></div><p>Traits: <code>AlwaysSpeculatableImplTrait</code>, <code>Elementwise</code>, <code>SameOperandsAndResultType</code></p><p>Interfaces: <code>ArithFastMathInterface</code>, <code>ConditionallySpeculatable</code>, <code>InferTypeOpInterface</code>, <code>NoMemoryEffect (MemoryEffectOpInterface)</code></p><p>Effects: <code>MemoryEffects::Effect{}</code></p><h4 id=attributes-7>Attributes: <a class=headline-hash href=#attributes-7>¶</a></h4><table><tr><th>Attribute</th><th>MLIR Type</th><th>Description</th></tr><tr><td><code>fastmath</code></td><td>::mlir::arith::FastMathFlagsAttr</td><td><details><summary>Floating point fast math flags</summary><p>Enum cases:</p><ul><li>none (<code>none</code>)</li><li>reassoc (<code>reassoc</code>)</li><li>nnan (<code>nnan</code>)</li><li>ninf (<code>ninf</code>)</li><li>nsz (<code>nsz</code>)</li><li>arcp (<code>arcp</code>)</li><li>contract (<code>contract</code>)</li><li>afn (<code>afn</code>)</li><li>fast (<code>fast</code>)</li></ul></details></td></tr></table><h4 id=operands-8>Operands: <a class=headline-hash href=#operands-8>¶</a></h4><table><thead><tr><th style=text-align:center>Operand</th><th>Description</th></tr></thead><tbody><tr><td style=text-align:center><code>lhs</code></td><td>complex type with floating-point elements</td></tr><tr><td style=text-align:center><code>rhs</code></td><td>complex type with floating-point elements</td></tr></tbody></table><h4 id=results-9>Results: <a class=headline-hash href=#results-9>¶</a></h4><table><thead><tr><th style=text-align:center>Result</th><th>Description</th></tr></thead><tbody><tr><td style=text-align:center><code>result</code></td><td>complex type with floating-point elements</td></tr></tbody></table><h3 id=complexeq-complexequalop><code>complex.eq</code> (complex::EqualOp) <a class=headline-hash href=#complexeq-complexequalop>¶</a></h3><p><em>Computes whether two complex values are equal</em></p><p>Syntax:</p><pre tabindex=0><code>operation ::= `complex.eq` $lhs `,` $rhs attr-dict `:` type($lhs) </code></pre><p>The <code>eq</code> op takes two complex numbers and returns whether they are equal.</p><p>Example:</p><div class=highlight><pre tabindex=0 class=chroma><code class=language-mlir data-lang=mlir><span class=line><span class=cl><span class=nv>%a</span> <span class=p>=</span> complex<span class=p>.</span>eq <span class=nv>%b</span><span class=p>,</span> <span class=nv>%c</span> <span class=p>:</span> complex<span class=p><</span><span class=k>f32</span><span class=p>></span> </span></span></code></pre></div><p>Traits: <code>AlwaysSpeculatableImplTrait</code>, <code>Elementwise</code></p><p>Interfaces: <code>ConditionallySpeculatable</code>, <code>InferTypeOpInterface</code>, <code>NoMemoryEffect (MemoryEffectOpInterface)</code></p><p>Effects: <code>MemoryEffects::Effect{}</code></p><h4 id=operands-9>Operands: <a class=headline-hash href=#operands-9>¶</a></h4><table><thead><tr><th style=text-align:center>Operand</th><th>Description</th></tr></thead><tbody><tr><td style=text-align:center><code>lhs</code></td><td>complex type with floating-point elements</td></tr><tr><td style=text-align:center><code>rhs</code></td><td>complex type with floating-point elements</td></tr></tbody></table><h4 id=results-10>Results: <a class=headline-hash href=#results-10>¶</a></h4><table><thead><tr><th style=text-align:center>Result</th><th>Description</th></tr></thead><tbody><tr><td style=text-align:center><code>result</code></td><td>1-bit signless integer</td></tr></tbody></table><h3 id=complexexp-complexexpop><code>complex.exp</code> (complex::ExpOp) <a class=headline-hash href=#complexexp-complexexpop>¶</a></h3><p><em>Computes exponential of a complex number</em></p><p>Syntax:</p><pre tabindex=0><code>operation ::= `complex.exp` $complex (`fastmath` `` $fastmath^)? attr-dict `:` type($complex) </code></pre><p>The <code>exp</code> op takes a single complex number and computes the exponential of it, i.e. <code>exp(x)</code> or <code>e^(x)</code>, where <code>x</code> is the input value. <code>e</code> denotes Euler’s number and is approximately equal to 2.718281.</p><p>Example:</p><div class=highlight><pre tabindex=0 class=chroma><code class=language-mlir data-lang=mlir><span class=line><span class=cl><span class=nv>%a</span> <span class=p>=</span> complex<span class=p>.</span>exp <span class=nv>%b</span> <span class=p>:</span> complex<span class=p><</span><span class=k>f32</span><span class=p>></span> </span></span></code></pre></div><p>Traits: <code>AlwaysSpeculatableImplTrait</code>, <code>Elementwise</code>, <code>SameOperandsAndResultType</code></p><p>Interfaces: <code>ArithFastMathInterface</code>, <code>ConditionallySpeculatable</code>, <code>InferTypeOpInterface</code>, <code>NoMemoryEffect (MemoryEffectOpInterface)</code></p><p>Effects: <code>MemoryEffects::Effect{}</code></p><h4 id=attributes-8>Attributes: <a class=headline-hash href=#attributes-8>¶</a></h4><table><tr><th>Attribute</th><th>MLIR Type</th><th>Description</th></tr><tr><td><code>fastmath</code></td><td>::mlir::arith::FastMathFlagsAttr</td><td><details><summary>Floating point fast math flags</summary><p>Enum cases:</p><ul><li>none (<code>none</code>)</li><li>reassoc (<code>reassoc</code>)</li><li>nnan (<code>nnan</code>)</li><li>ninf (<code>ninf</code>)</li><li>nsz (<code>nsz</code>)</li><li>arcp (<code>arcp</code>)</li><li>contract (<code>contract</code>)</li><li>afn (<code>afn</code>)</li><li>fast (<code>fast</code>)</li></ul></details></td></tr></table><h4 id=operands-10>Operands: <a class=headline-hash href=#operands-10>¶</a></h4><table><thead><tr><th style=text-align:center>Operand</th><th>Description</th></tr></thead><tbody><tr><td style=text-align:center><code>complex</code></td><td>complex type with floating-point elements</td></tr></tbody></table><h4 id=results-11>Results: <a class=headline-hash href=#results-11>¶</a></h4><table><thead><tr><th style=text-align:center>Result</th><th>Description</th></tr></thead><tbody><tr><td style=text-align:center><code>result</code></td><td>complex type with floating-point elements</td></tr></tbody></table><h3 id=complexexpm1-complexexpm1op><code>complex.expm1</code> (complex::Expm1Op) <a class=headline-hash href=#complexexpm1-complexexpm1op>¶</a></h3><p><em>Computes exponential of a complex number minus 1</em></p><p>Syntax:</p><pre tabindex=0><code>operation ::= `complex.expm1` $complex (`fastmath` `` $fastmath^)? attr-dict `:` type($complex) </code></pre><p>complex.expm1(x) := complex.exp(x) - 1</p><p>Example:</p><div class=highlight><pre tabindex=0 class=chroma><code class=language-mlir data-lang=mlir><span class=line><span class=cl><span class=nv>%a</span> <span class=p>=</span> complex<span class=p>.</span>expm1 <span class=nv>%b</span> <span class=p>:</span> complex<span class=p><</span><span class=k>f32</span><span class=p>></span> </span></span></code></pre></div><p>Traits: <code>AlwaysSpeculatableImplTrait</code>, <code>Elementwise</code>, <code>SameOperandsAndResultType</code></p><p>Interfaces: <code>ArithFastMathInterface</code>, <code>ConditionallySpeculatable</code>, <code>InferTypeOpInterface</code>, <code>NoMemoryEffect (MemoryEffectOpInterface)</code></p><p>Effects: <code>MemoryEffects::Effect{}</code></p><h4 id=attributes-9>Attributes: <a class=headline-hash href=#attributes-9>¶</a></h4><table><tr><th>Attribute</th><th>MLIR Type</th><th>Description</th></tr><tr><td><code>fastmath</code></td><td>::mlir::arith::FastMathFlagsAttr</td><td><details><summary>Floating point fast math flags</summary><p>Enum cases:</p><ul><li>none (<code>none</code>)</li><li>reassoc (<code>reassoc</code>)</li><li>nnan (<code>nnan</code>)</li><li>ninf (<code>ninf</code>)</li><li>nsz (<code>nsz</code>)</li><li>arcp (<code>arcp</code>)</li><li>contract (<code>contract</code>)</li><li>afn (<code>afn</code>)</li><li>fast (<code>fast</code>)</li></ul></details></td></tr></table><h4 id=operands-11>Operands: <a class=headline-hash href=#operands-11>¶</a></h4><table><thead><tr><th style=text-align:center>Operand</th><th>Description</th></tr></thead><tbody><tr><td style=text-align:center><code>complex</code></td><td>complex type with floating-point elements</td></tr></tbody></table><h4 id=results-12>Results: <a class=headline-hash href=#results-12>¶</a></h4><table><thead><tr><th style=text-align:center>Result</th><th>Description</th></tr></thead><tbody><tr><td style=text-align:center><code>result</code></td><td>complex type with floating-point elements</td></tr></tbody></table><h3 id=complexim-compleximop><code>complex.im</code> (complex::ImOp) <a class=headline-hash href=#complexim-compleximop>¶</a></h3><p><em>Extracts the imaginary part of a complex number</em></p><p>Syntax:</p><pre tabindex=0><code>operation ::= `complex.im` $complex (`fastmath` `` $fastmath^)? attr-dict `:` type($complex) </code></pre><p>The <code>im</code> op takes a single complex number and extracts the imaginary part.</p><p>Example:</p><div class=highlight><pre tabindex=0 class=chroma><code class=language-mlir data-lang=mlir><span class=line><span class=cl><span class=nv>%a</span> <span class=p>=</span> complex<span class=p>.</span>im <span class=nv>%b</span> <span class=p>:</span> complex<span class=p><</span><span class=k>f32</span><span class=p>></span> </span></span></code></pre></div><p>Traits: <code>AlwaysSpeculatableImplTrait</code>, <code>Elementwise</code></p><p>Interfaces: <code>ArithFastMathInterface</code>, <code>ConditionallySpeculatable</code>, <code>InferTypeOpInterface</code>, <code>NoMemoryEffect (MemoryEffectOpInterface)</code></p><p>Effects: <code>MemoryEffects::Effect{}</code></p><h4 id=attributes-10>Attributes: <a class=headline-hash href=#attributes-10>¶</a></h4><table><tr><th>Attribute</th><th>MLIR Type</th><th>Description</th></tr><tr><td><code>fastmath</code></td><td>::mlir::arith::FastMathFlagsAttr</td><td><details><summary>Floating point fast math flags</summary><p>Enum cases:</p><ul><li>none (<code>none</code>)</li><li>reassoc (<code>reassoc</code>)</li><li>nnan (<code>nnan</code>)</li><li>ninf (<code>ninf</code>)</li><li>nsz (<code>nsz</code>)</li><li>arcp (<code>arcp</code>)</li><li>contract (<code>contract</code>)</li><li>afn (<code>afn</code>)</li><li>fast (<code>fast</code>)</li></ul></details></td></tr></table><h4 id=operands-12>Operands: <a class=headline-hash href=#operands-12>¶</a></h4><table><thead><tr><th style=text-align:center>Operand</th><th>Description</th></tr></thead><tbody><tr><td style=text-align:center><code>complex</code></td><td>complex type with floating-point elements</td></tr></tbody></table><h4 id=results-13>Results: <a class=headline-hash href=#results-13>¶</a></h4><table><thead><tr><th style=text-align:center>Result</th><th>Description</th></tr></thead><tbody><tr><td style=text-align:center><code>imaginary</code></td><td>floating-point</td></tr></tbody></table><h3 id=complexlog-complexlogop><code>complex.log</code> (complex::LogOp) <a class=headline-hash href=#complexlog-complexlogop>¶</a></h3><p><em>Computes natural logarithm of a complex number</em></p><p>Syntax:</p><pre tabindex=0><code>operation ::= `complex.log` $complex (`fastmath` `` $fastmath^)? attr-dict `:` type($complex) </code></pre><p>The <code>log</code> op takes a single complex number and computes the natural logarithm of it, i.e. <code>log(x)</code> or <code>log_e(x)</code>, where <code>x</code> is the input value. <code>e</code> denotes Euler’s number and is approximately equal to 2.718281.</p><p>Example:</p><div class=highlight><pre tabindex=0 class=chroma><code class=language-mlir data-lang=mlir><span class=line><span class=cl><span class=nv>%a</span> <span class=p>=</span> complex<span class=p>.</span>log <span class=nv>%b</span> <span class=p>:</span> complex<span class=p><</span><span class=k>f32</span><span class=p>></span> </span></span></code></pre></div><p>Traits: <code>AlwaysSpeculatableImplTrait</code>, <code>Elementwise</code>, <code>SameOperandsAndResultType</code></p><p>Interfaces: <code>ArithFastMathInterface</code>, <code>ConditionallySpeculatable</code>, <code>InferTypeOpInterface</code>, <code>NoMemoryEffect (MemoryEffectOpInterface)</code></p><p>Effects: <code>MemoryEffects::Effect{}</code></p><h4 id=attributes-11>Attributes: <a class=headline-hash href=#attributes-11>¶</a></h4><table><tr><th>Attribute</th><th>MLIR Type</th><th>Description</th></tr><tr><td><code>fastmath</code></td><td>::mlir::arith::FastMathFlagsAttr</td><td><details><summary>Floating point fast math flags</summary><p>Enum cases:</p><ul><li>none (<code>none</code>)</li><li>reassoc (<code>reassoc</code>)</li><li>nnan (<code>nnan</code>)</li><li>ninf (<code>ninf</code>)</li><li>nsz (<code>nsz</code>)</li><li>arcp (<code>arcp</code>)</li><li>contract (<code>contract</code>)</li><li>afn (<code>afn</code>)</li><li>fast (<code>fast</code>)</li></ul></details></td></tr></table><h4 id=operands-13>Operands: <a class=headline-hash href=#operands-13>¶</a></h4><table><thead><tr><th style=text-align:center>Operand</th><th>Description</th></tr></thead><tbody><tr><td style=text-align:center><code>complex</code></td><td>complex type with floating-point elements</td></tr></tbody></table><h4 id=results-14>Results: <a class=headline-hash href=#results-14>¶</a></h4><table><thead><tr><th style=text-align:center>Result</th><th>Description</th></tr></thead><tbody><tr><td style=text-align:center><code>result</code></td><td>complex type with floating-point elements</td></tr></tbody></table><h3 id=complexlog1p-complexlog1pop><code>complex.log1p</code> (complex::Log1pOp) <a class=headline-hash href=#complexlog1p-complexlog1pop>¶</a></h3><p><em>Computes natural logarithm of a complex number</em></p><p>Syntax:</p><pre tabindex=0><code>operation ::= `complex.log1p` $complex (`fastmath` `` $fastmath^)? attr-dict `:` type($complex) </code></pre><p>The <code>log</code> op takes a single complex number and computes the natural logarithm of one plus the given value, i.e. <code>log(1 + x)</code> or <code>log_e(1 + x)</code>, where <code>x</code> is the input value. <code>e</code> denotes Euler’s number and is approximately equal to 2.718281.</p><p>Example:</p><div class=highlight><pre tabindex=0 class=chroma><code class=language-mlir data-lang=mlir><span class=line><span class=cl><span class=nv>%a</span> <span class=p>=</span> complex<span class=p>.</span>log1p <span class=nv>%b</span> <span class=p>:</span> complex<span class=p><</span><span class=k>f32</span><span class=p>></span> </span></span></code></pre></div><p>Traits: <code>AlwaysSpeculatableImplTrait</code>, <code>Elementwise</code>, <code>SameOperandsAndResultType</code></p><p>Interfaces: <code>ArithFastMathInterface</code>, <code>ConditionallySpeculatable</code>, <code>InferTypeOpInterface</code>, <code>NoMemoryEffect (MemoryEffectOpInterface)</code></p><p>Effects: <code>MemoryEffects::Effect{}</code></p><h4 id=attributes-12>Attributes: <a class=headline-hash href=#attributes-12>¶</a></h4><table><tr><th>Attribute</th><th>MLIR Type</th><th>Description</th></tr><tr><td><code>fastmath</code></td><td>::mlir::arith::FastMathFlagsAttr</td><td><details><summary>Floating point fast math flags</summary><p>Enum cases:</p><ul><li>none (<code>none</code>)</li><li>reassoc (<code>reassoc</code>)</li><li>nnan (<code>nnan</code>)</li><li>ninf (<code>ninf</code>)</li><li>nsz (<code>nsz</code>)</li><li>arcp (<code>arcp</code>)</li><li>contract (<code>contract</code>)</li><li>afn (<code>afn</code>)</li><li>fast (<code>fast</code>)</li></ul></details></td></tr></table><h4 id=operands-14>Operands: <a class=headline-hash href=#operands-14>¶</a></h4><table><thead><tr><th style=text-align:center>Operand</th><th>Description</th></tr></thead><tbody><tr><td style=text-align:center><code>complex</code></td><td>complex type with floating-point elements</td></tr></tbody></table><h4 id=results-15>Results: <a class=headline-hash href=#results-15>¶</a></h4><table><thead><tr><th style=text-align:center>Result</th><th>Description</th></tr></thead><tbody><tr><td style=text-align:center><code>result</code></td><td>complex type with floating-point elements</td></tr></tbody></table><h3 id=complexmul-complexmulop><code>complex.mul</code> (complex::MulOp) <a class=headline-hash href=#complexmul-complexmulop>¶</a></h3><p><em>Complex multiplication</em></p><p>Syntax:</p><pre tabindex=0><code>operation ::= `complex.mul` $lhs `,` $rhs (`fastmath` `` $fastmath^)? attr-dict `:` type($result) </code></pre><p>The <code>mul</code> operation takes two complex numbers and returns their product:</p><div class=highlight><pre tabindex=0 class=chroma><code class=language-mlir data-lang=mlir><span class=line><span class=cl><span class=nv>%a</span> <span class=p>=</span> complex<span class=p>.</span>mul <span class=nv>%b</span><span class=p>,</span> <span class=nv>%c</span> <span class=p>:</span> complex<span class=p><</span><span class=k>f32</span><span class=p>></span> </span></span></code></pre></div><p>Traits: <code>AlwaysSpeculatableImplTrait</code>, <code>Elementwise</code>, <code>SameOperandsAndResultType</code></p><p>Interfaces: <code>ArithFastMathInterface</code>, <code>ConditionallySpeculatable</code>, <code>InferTypeOpInterface</code>, <code>NoMemoryEffect (MemoryEffectOpInterface)</code></p><p>Effects: <code>MemoryEffects::Effect{}</code></p><h4 id=attributes-13>Attributes: <a class=headline-hash href=#attributes-13>¶</a></h4><table><tr><th>Attribute</th><th>MLIR Type</th><th>Description</th></tr><tr><td><code>fastmath</code></td><td>::mlir::arith::FastMathFlagsAttr</td><td><details><summary>Floating point fast math flags</summary><p>Enum cases:</p><ul><li>none (<code>none</code>)</li><li>reassoc (<code>reassoc</code>)</li><li>nnan (<code>nnan</code>)</li><li>ninf (<code>ninf</code>)</li><li>nsz (<code>nsz</code>)</li><li>arcp (<code>arcp</code>)</li><li>contract (<code>contract</code>)</li><li>afn (<code>afn</code>)</li><li>fast (<code>fast</code>)</li></ul></details></td></tr></table><h4 id=operands-15>Operands: <a class=headline-hash href=#operands-15>¶</a></h4><table><thead><tr><th style=text-align:center>Operand</th><th>Description</th></tr></thead><tbody><tr><td style=text-align:center><code>lhs</code></td><td>complex type with floating-point elements</td></tr><tr><td style=text-align:center><code>rhs</code></td><td>complex type with floating-point elements</td></tr></tbody></table><h4 id=results-16>Results: <a class=headline-hash href=#results-16>¶</a></h4><table><thead><tr><th style=text-align:center>Result</th><th>Description</th></tr></thead><tbody><tr><td style=text-align:center><code>result</code></td><td>complex type with floating-point elements</td></tr></tbody></table><h3 id=complexneg-complexnegop><code>complex.neg</code> (complex::NegOp) <a class=headline-hash href=#complexneg-complexnegop>¶</a></h3><p><em>Negation operator</em></p><p>Syntax:</p><pre tabindex=0><code>operation ::= `complex.neg` $complex (`fastmath` `` $fastmath^)? attr-dict `:` type($complex) </code></pre><p>The <code>neg</code> op takes a single complex number <code>complex</code> and returns <code>-complex</code>.</p><p>Example:</p><div class=highlight><pre tabindex=0 class=chroma><code class=language-mlir data-lang=mlir><span class=line><span class=cl><span class=nv>%a</span> <span class=p>=</span> complex<span class=p>.</span>neg <span class=nv>%b</span> <span class=p>:</span> complex<span class=p><</span><span class=k>f32</span><span class=p>></span> </span></span></code></pre></div><p>Traits: <code>AlwaysSpeculatableImplTrait</code>, <code>Elementwise</code>, <code>SameOperandsAndResultType</code></p><p>Interfaces: <code>ArithFastMathInterface</code>, <code>ConditionallySpeculatable</code>, <code>InferTypeOpInterface</code>, <code>NoMemoryEffect (MemoryEffectOpInterface)</code></p><p>Effects: <code>MemoryEffects::Effect{}</code></p><h4 id=attributes-14>Attributes: <a class=headline-hash href=#attributes-14>¶</a></h4><table><tr><th>Attribute</th><th>MLIR Type</th><th>Description</th></tr><tr><td><code>fastmath</code></td><td>::mlir::arith::FastMathFlagsAttr</td><td><details><summary>Floating point fast math flags</summary><p>Enum cases:</p><ul><li>none (<code>none</code>)</li><li>reassoc (<code>reassoc</code>)</li><li>nnan (<code>nnan</code>)</li><li>ninf (<code>ninf</code>)</li><li>nsz (<code>nsz</code>)</li><li>arcp (<code>arcp</code>)</li><li>contract (<code>contract</code>)</li><li>afn (<code>afn</code>)</li><li>fast (<code>fast</code>)</li></ul></details></td></tr></table><h4 id=operands-16>Operands: <a class=headline-hash href=#operands-16>¶</a></h4><table><thead><tr><th style=text-align:center>Operand</th><th>Description</th></tr></thead><tbody><tr><td style=text-align:center><code>complex</code></td><td>complex type with floating-point elements</td></tr></tbody></table><h4 id=results-17>Results: <a class=headline-hash href=#results-17>¶</a></h4><table><thead><tr><th style=text-align:center>Result</th><th>Description</th></tr></thead><tbody><tr><td style=text-align:center><code>result</code></td><td>complex type with floating-point elements</td></tr></tbody></table><h3 id=complexneq-complexnotequalop><code>complex.neq</code> (complex::NotEqualOp) <a class=headline-hash href=#complexneq-complexnotequalop>¶</a></h3><p><em>Computes whether two complex values are not equal</em></p><p>Syntax:</p><pre tabindex=0><code>operation ::= `complex.neq` $lhs `,` $rhs attr-dict `:` type($lhs) </code></pre><p>The <code>neq</code> op takes two complex numbers and returns whether they are not equal.</p><p>Example:</p><div class=highlight><pre tabindex=0 class=chroma><code class=language-mlir data-lang=mlir><span class=line><span class=cl><span class=nv>%a</span> <span class=p>=</span> complex<span class=p>.</span>neq <span class=nv>%b</span><span class=p>,</span> <span class=nv>%c</span> <span class=p>:</span> complex<span class=p><</span><span class=k>f32</span><span class=p>></span> </span></span></code></pre></div><p>Traits: <code>AlwaysSpeculatableImplTrait</code>, <code>Elementwise</code></p><p>Interfaces: <code>ConditionallySpeculatable</code>, <code>InferTypeOpInterface</code>, <code>NoMemoryEffect (MemoryEffectOpInterface)</code></p><p>Effects: <code>MemoryEffects::Effect{}</code></p><h4 id=operands-17>Operands: <a class=headline-hash href=#operands-17>¶</a></h4><table><thead><tr><th style=text-align:center>Operand</th><th>Description</th></tr></thead><tbody><tr><td style=text-align:center><code>lhs</code></td><td>complex type with floating-point elements</td></tr><tr><td style=text-align:center><code>rhs</code></td><td>complex type with floating-point elements</td></tr></tbody></table><h4 id=results-18>Results: <a class=headline-hash href=#results-18>¶</a></h4><table><thead><tr><th style=text-align:center>Result</th><th>Description</th></tr></thead><tbody><tr><td style=text-align:center><code>result</code></td><td>1-bit signless integer</td></tr></tbody></table><h3 id=complexpow-complexpowop><code>complex.pow</code> (complex::PowOp) <a class=headline-hash href=#complexpow-complexpowop>¶</a></h3><p><em>Complex power function</em></p><p>Syntax:</p><pre tabindex=0><code>operation ::= `complex.pow` $lhs `,` $rhs (`fastmath` `` $fastmath^)? attr-dict `:` type($result) </code></pre><p>The <code>sqrt</code> operation takes a complex number raises it to the given complex exponent.</p><p>Example:</p><div class=highlight><pre tabindex=0 class=chroma><code class=language-mlir data-lang=mlir><span class=line><span class=cl><span class=nv>%a</span> <span class=p>=</span> complex<span class=p>.</span>pow <span class=nv>%b</span><span class=p>,</span> <span class=nv>%c</span> <span class=p>:</span> complex<span class=p><</span><span class=k>f32</span><span class=p>></span> </span></span></code></pre></div><p>Traits: <code>AlwaysSpeculatableImplTrait</code>, <code>Elementwise</code>, <code>SameOperandsAndResultType</code></p><p>Interfaces: <code>ArithFastMathInterface</code>, <code>ConditionallySpeculatable</code>, <code>InferTypeOpInterface</code>, <code>NoMemoryEffect (MemoryEffectOpInterface)</code></p><p>Effects: <code>MemoryEffects::Effect{}</code></p><h4 id=attributes-15>Attributes: <a class=headline-hash href=#attributes-15>¶</a></h4><table><tr><th>Attribute</th><th>MLIR Type</th><th>Description</th></tr><tr><td><code>fastmath</code></td><td>::mlir::arith::FastMathFlagsAttr</td><td><details><summary>Floating point fast math flags</summary><p>Enum cases:</p><ul><li>none (<code>none</code>)</li><li>reassoc (<code>reassoc</code>)</li><li>nnan (<code>nnan</code>)</li><li>ninf (<code>ninf</code>)</li><li>nsz (<code>nsz</code>)</li><li>arcp (<code>arcp</code>)</li><li>contract (<code>contract</code>)</li><li>afn (<code>afn</code>)</li><li>fast (<code>fast</code>)</li></ul></details></td></tr></table><h4 id=operands-18>Operands: <a class=headline-hash href=#operands-18>¶</a></h4><table><thead><tr><th style=text-align:center>Operand</th><th>Description</th></tr></thead><tbody><tr><td style=text-align:center><code>lhs</code></td><td>complex type with floating-point elements</td></tr><tr><td style=text-align:center><code>rhs</code></td><td>complex type with floating-point elements</td></tr></tbody></table><h4 id=results-19>Results: <a class=headline-hash href=#results-19>¶</a></h4><table><thead><tr><th style=text-align:center>Result</th><th>Description</th></tr></thead><tbody><tr><td style=text-align:center><code>result</code></td><td>complex type with floating-point elements</td></tr></tbody></table><h3 id=complexre-complexreop><code>complex.re</code> (complex::ReOp) <a class=headline-hash href=#complexre-complexreop>¶</a></h3><p><em>Extracts the real part of a complex number</em></p><p>Syntax:</p><pre tabindex=0><code>operation ::= `complex.re` $complex (`fastmath` `` $fastmath^)? attr-dict `:` type($complex) </code></pre><p>The <code>re</code> op takes a single complex number and extracts the real part.</p><p>Example:</p><div class=highlight><pre tabindex=0 class=chroma><code class=language-mlir data-lang=mlir><span class=line><span class=cl><span class=nv>%a</span> <span class=p>=</span> complex<span class=p>.</span>re <span class=nv>%b</span> <span class=p>:</span> complex<span class=p><</span><span class=k>f32</span><span class=p>></span> </span></span></code></pre></div><p>Traits: <code>AlwaysSpeculatableImplTrait</code>, <code>Elementwise</code></p><p>Interfaces: <code>ArithFastMathInterface</code>, <code>ConditionallySpeculatable</code>, <code>InferTypeOpInterface</code>, <code>NoMemoryEffect (MemoryEffectOpInterface)</code></p><p>Effects: <code>MemoryEffects::Effect{}</code></p><h4 id=attributes-16>Attributes: <a class=headline-hash href=#attributes-16>¶</a></h4><table><tr><th>Attribute</th><th>MLIR Type</th><th>Description</th></tr><tr><td><code>fastmath</code></td><td>::mlir::arith::FastMathFlagsAttr</td><td><details><summary>Floating point fast math flags</summary><p>Enum cases:</p><ul><li>none (<code>none</code>)</li><li>reassoc (<code>reassoc</code>)</li><li>nnan (<code>nnan</code>)</li><li>ninf (<code>ninf</code>)</li><li>nsz (<code>nsz</code>)</li><li>arcp (<code>arcp</code>)</li><li>contract (<code>contract</code>)</li><li>afn (<code>afn</code>)</li><li>fast (<code>fast</code>)</li></ul></details></td></tr></table><h4 id=operands-19>Operands: <a class=headline-hash href=#operands-19>¶</a></h4><table><thead><tr><th style=text-align:center>Operand</th><th>Description</th></tr></thead><tbody><tr><td style=text-align:center><code>complex</code></td><td>complex type with floating-point elements</td></tr></tbody></table><h4 id=results-20>Results: <a class=headline-hash href=#results-20>¶</a></h4><table><thead><tr><th style=text-align:center>Result</th><th>Description</th></tr></thead><tbody><tr><td style=text-align:center><code>real</code></td><td>floating-point</td></tr></tbody></table><h3 id=complexrsqrt-complexrsqrtop><code>complex.rsqrt</code> (complex::RsqrtOp) <a class=headline-hash href=#complexrsqrt-complexrsqrtop>¶</a></h3><p><em>Complex reciprocal of square root</em></p><p>Syntax:</p><pre tabindex=0><code>operation ::= `complex.rsqrt` $complex (`fastmath` `` $fastmath^)? attr-dict `:` type($complex) </code></pre><p>The <code>rsqrt</code> operation computes reciprocal of square root.</p><p>Example:</p><div class=highlight><pre tabindex=0 class=chroma><code class=language-mlir data-lang=mlir><span class=line><span class=cl><span class=nv>%a</span> <span class=p>=</span> complex<span class=p>.</span>rsqrt <span class=nv>%b</span> <span class=p>:</span> complex<span class=p><</span><span class=k>f32</span><span class=p>></span> </span></span></code></pre></div><p>Traits: <code>AlwaysSpeculatableImplTrait</code>, <code>Elementwise</code>, <code>SameOperandsAndResultType</code></p><p>Interfaces: <code>ArithFastMathInterface</code>, <code>ConditionallySpeculatable</code>, <code>InferTypeOpInterface</code>, <code>NoMemoryEffect (MemoryEffectOpInterface)</code></p><p>Effects: <code>MemoryEffects::Effect{}</code></p><h4 id=attributes-17>Attributes: <a class=headline-hash href=#attributes-17>¶</a></h4><table><tr><th>Attribute</th><th>MLIR Type</th><th>Description</th></tr><tr><td><code>fastmath</code></td><td>::mlir::arith::FastMathFlagsAttr</td><td><details><summary>Floating point fast math flags</summary><p>Enum cases:</p><ul><li>none (<code>none</code>)</li><li>reassoc (<code>reassoc</code>)</li><li>nnan (<code>nnan</code>)</li><li>ninf (<code>ninf</code>)</li><li>nsz (<code>nsz</code>)</li><li>arcp (<code>arcp</code>)</li><li>contract (<code>contract</code>)</li><li>afn (<code>afn</code>)</li><li>fast (<code>fast</code>)</li></ul></details></td></tr></table><h4 id=operands-20>Operands: <a class=headline-hash href=#operands-20>¶</a></h4><table><thead><tr><th style=text-align:center>Operand</th><th>Description</th></tr></thead><tbody><tr><td style=text-align:center><code>complex</code></td><td>complex type with floating-point elements</td></tr></tbody></table><h4 id=results-21>Results: <a class=headline-hash href=#results-21>¶</a></h4><table><thead><tr><th style=text-align:center>Result</th><th>Description</th></tr></thead><tbody><tr><td style=text-align:center><code>result</code></td><td>complex type with floating-point elements</td></tr></tbody></table><h3 id=complexsign-complexsignop><code>complex.sign</code> (complex::SignOp) <a class=headline-hash href=#complexsign-complexsignop>¶</a></h3><p><em>Computes sign of a complex number</em></p><p>Syntax:</p><pre tabindex=0><code>operation ::= `complex.sign` $complex (`fastmath` `` $fastmath^)? attr-dict `:` type($complex) </code></pre><p>The <code>sign</code> op takes a single complex number and computes the sign of it, i.e. <code>y = sign(x) = x / |x|</code> if <code>x != 0</code>, otherwise <code>y = 0</code>.</p><p>Example:</p><div class=highlight><pre tabindex=0 class=chroma><code class=language-mlir data-lang=mlir><span class=line><span class=cl><span class=nv>%a</span> <span class=p>=</span> complex<span class=p>.</span>sign <span class=nv>%b</span> <span class=p>:</span> complex<span class=p><</span><span class=k>f32</span><span class=p>></span> </span></span></code></pre></div><p>Traits: <code>AlwaysSpeculatableImplTrait</code>, <code>Elementwise</code>, <code>SameOperandsAndResultType</code></p><p>Interfaces: <code>ArithFastMathInterface</code>, <code>ConditionallySpeculatable</code>, <code>InferTypeOpInterface</code>, <code>NoMemoryEffect (MemoryEffectOpInterface)</code></p><p>Effects: <code>MemoryEffects::Effect{}</code></p><h4 id=attributes-18>Attributes: <a class=headline-hash href=#attributes-18>¶</a></h4><table><tr><th>Attribute</th><th>MLIR Type</th><th>Description</th></tr><tr><td><code>fastmath</code></td><td>::mlir::arith::FastMathFlagsAttr</td><td><details><summary>Floating point fast math flags</summary><p>Enum cases:</p><ul><li>none (<code>none</code>)</li><li>reassoc (<code>reassoc</code>)</li><li>nnan (<code>nnan</code>)</li><li>ninf (<code>ninf</code>)</li><li>nsz (<code>nsz</code>)</li><li>arcp (<code>arcp</code>)</li><li>contract (<code>contract</code>)</li><li>afn (<code>afn</code>)</li><li>fast (<code>fast</code>)</li></ul></details></td></tr></table><h4 id=operands-21>Operands: <a class=headline-hash href=#operands-21>¶</a></h4><table><thead><tr><th style=text-align:center>Operand</th><th>Description</th></tr></thead><tbody><tr><td style=text-align:center><code>complex</code></td><td>complex type with floating-point elements</td></tr></tbody></table><h4 id=results-22>Results: <a class=headline-hash href=#results-22>¶</a></h4><table><thead><tr><th style=text-align:center>Result</th><th>Description</th></tr></thead><tbody><tr><td style=text-align:center><code>result</code></td><td>complex type with floating-point elements</td></tr></tbody></table><h3 id=complexsin-complexsinop><code>complex.sin</code> (complex::SinOp) <a class=headline-hash href=#complexsin-complexsinop>¶</a></h3><p><em>Computes sine of a complex number</em></p><p>Syntax:</p><pre tabindex=0><code>operation ::= `complex.sin` $complex (`fastmath` `` $fastmath^)? attr-dict `:` type($complex) </code></pre><p>The <code>sin</code> op takes a single complex number and computes the sine of it, i.e. <code>sin(x)</code>, where <code>x</code> is the input value.</p><p>Example:</p><div class=highlight><pre tabindex=0 class=chroma><code class=language-mlir data-lang=mlir><span class=line><span class=cl><span class=nv>%a</span> <span class=p>=</span> complex<span class=p>.</span>sin <span class=nv>%b</span> <span class=p>:</span> complex<span class=p><</span><span class=k>f32</span><span class=p>></span> </span></span></code></pre></div><p>Traits: <code>AlwaysSpeculatableImplTrait</code>, <code>Elementwise</code>, <code>SameOperandsAndResultType</code></p><p>Interfaces: <code>ArithFastMathInterface</code>, <code>ConditionallySpeculatable</code>, <code>InferTypeOpInterface</code>, <code>NoMemoryEffect (MemoryEffectOpInterface)</code></p><p>Effects: <code>MemoryEffects::Effect{}</code></p><h4 id=attributes-19>Attributes: <a class=headline-hash href=#attributes-19>¶</a></h4><table><tr><th>Attribute</th><th>MLIR Type</th><th>Description</th></tr><tr><td><code>fastmath</code></td><td>::mlir::arith::FastMathFlagsAttr</td><td><details><summary>Floating point fast math flags</summary><p>Enum cases:</p><ul><li>none (<code>none</code>)</li><li>reassoc (<code>reassoc</code>)</li><li>nnan (<code>nnan</code>)</li><li>ninf (<code>ninf</code>)</li><li>nsz (<code>nsz</code>)</li><li>arcp (<code>arcp</code>)</li><li>contract (<code>contract</code>)</li><li>afn (<code>afn</code>)</li><li>fast (<code>fast</code>)</li></ul></details></td></tr></table><h4 id=operands-22>Operands: <a class=headline-hash href=#operands-22>¶</a></h4><table><thead><tr><th style=text-align:center>Operand</th><th>Description</th></tr></thead><tbody><tr><td style=text-align:center><code>complex</code></td><td>complex type with floating-point elements</td></tr></tbody></table><h4 id=results-23>Results: <a class=headline-hash href=#results-23>¶</a></h4><table><thead><tr><th style=text-align:center>Result</th><th>Description</th></tr></thead><tbody><tr><td style=text-align:center><code>result</code></td><td>complex type with floating-point elements</td></tr></tbody></table><h3 id=complexsqrt-complexsqrtop><code>complex.sqrt</code> (complex::SqrtOp) <a class=headline-hash href=#complexsqrt-complexsqrtop>¶</a></h3><p><em>Complex square root</em></p><p>Syntax:</p><pre tabindex=0><code>operation ::= `complex.sqrt` $complex (`fastmath` `` $fastmath^)? attr-dict `:` type($complex) </code></pre><p>The <code>sqrt</code> operation takes a complex number and returns its square root.</p><p>Example:</p><div class=highlight><pre tabindex=0 class=chroma><code class=language-mlir data-lang=mlir><span class=line><span class=cl><span class=nv>%a</span> <span class=p>=</span> complex<span class=p>.</span>sqrt <span class=nv>%b</span> <span class=p>:</span> complex<span class=p><</span><span class=k>f32</span><span class=p>></span> </span></span></code></pre></div><p>Traits: <code>AlwaysSpeculatableImplTrait</code>, <code>Elementwise</code>, <code>SameOperandsAndResultType</code></p><p>Interfaces: <code>ArithFastMathInterface</code>, <code>ConditionallySpeculatable</code>, <code>InferTypeOpInterface</code>, <code>NoMemoryEffect (MemoryEffectOpInterface)</code></p><p>Effects: <code>MemoryEffects::Effect{}</code></p><h4 id=attributes-20>Attributes: <a class=headline-hash href=#attributes-20>¶</a></h4><table><tr><th>Attribute</th><th>MLIR Type</th><th>Description</th></tr><tr><td><code>fastmath</code></td><td>::mlir::arith::FastMathFlagsAttr</td><td><details><summary>Floating point fast math flags</summary><p>Enum cases:</p><ul><li>none (<code>none</code>)</li><li>reassoc (<code>reassoc</code>)</li><li>nnan (<code>nnan</code>)</li><li>ninf (<code>ninf</code>)</li><li>nsz (<code>nsz</code>)</li><li>arcp (<code>arcp</code>)</li><li>contract (<code>contract</code>)</li><li>afn (<code>afn</code>)</li><li>fast (<code>fast</code>)</li></ul></details></td></tr></table><h4 id=operands-23>Operands: <a class=headline-hash href=#operands-23>¶</a></h4><table><thead><tr><th style=text-align:center>Operand</th><th>Description</th></tr></thead><tbody><tr><td style=text-align:center><code>complex</code></td><td>complex type with floating-point elements</td></tr></tbody></table><h4 id=results-24>Results: <a class=headline-hash href=#results-24>¶</a></h4><table><thead><tr><th style=text-align:center>Result</th><th>Description</th></tr></thead><tbody><tr><td style=text-align:center><code>result</code></td><td>complex type with floating-point elements</td></tr></tbody></table><h3 id=complexsub-complexsubop><code>complex.sub</code> (complex::SubOp) <a class=headline-hash href=#complexsub-complexsubop>¶</a></h3><p><em>Complex subtraction</em></p><p>Syntax:</p><pre tabindex=0><code>operation ::= `complex.sub` $lhs `,` $rhs (`fastmath` `` $fastmath^)? attr-dict `:` type($result) </code></pre><p>The <code>sub</code> operation takes two complex numbers and returns their difference.</p><p>Example:</p><div class=highlight><pre tabindex=0 class=chroma><code class=language-mlir data-lang=mlir><span class=line><span class=cl><span class=nv>%a</span> <span class=p>=</span> complex<span class=p>.</span>sub <span class=nv>%b</span><span class=p>,</span> <span class=nv>%c</span> <span class=p>:</span> complex<span class=p><</span><span class=k>f32</span><span class=p>></span> </span></span></code></pre></div><p>Traits: <code>AlwaysSpeculatableImplTrait</code>, <code>Elementwise</code>, <code>SameOperandsAndResultType</code></p><p>Interfaces: <code>ArithFastMathInterface</code>, <code>ConditionallySpeculatable</code>, <code>InferTypeOpInterface</code>, <code>NoMemoryEffect (MemoryEffectOpInterface)</code></p><p>Effects: <code>MemoryEffects::Effect{}</code></p><h4 id=attributes-21>Attributes: <a class=headline-hash href=#attributes-21>¶</a></h4><table><tr><th>Attribute</th><th>MLIR Type</th><th>Description</th></tr><tr><td><code>fastmath</code></td><td>::mlir::arith::FastMathFlagsAttr</td><td><details><summary>Floating point fast math flags</summary><p>Enum cases:</p><ul><li>none (<code>none</code>)</li><li>reassoc (<code>reassoc</code>)</li><li>nnan (<code>nnan</code>)</li><li>ninf (<code>ninf</code>)</li><li>nsz (<code>nsz</code>)</li><li>arcp (<code>arcp</code>)</li><li>contract (<code>contract</code>)</li><li>afn (<code>afn</code>)</li><li>fast (<code>fast</code>)</li></ul></details></td></tr></table><h4 id=operands-24>Operands: <a class=headline-hash href=#operands-24>¶</a></h4><table><thead><tr><th style=text-align:center>Operand</th><th>Description</th></tr></thead><tbody><tr><td style=text-align:center><code>lhs</code></td><td>complex type with floating-point elements</td></tr><tr><td style=text-align:center><code>rhs</code></td><td>complex type with floating-point elements</td></tr></tbody></table><h4 id=results-25>Results: <a class=headline-hash href=#results-25>¶</a></h4><table><thead><tr><th style=text-align:center>Result</th><th>Description</th></tr></thead><tbody><tr><td style=text-align:center><code>result</code></td><td>complex type with floating-point elements</td></tr></tbody></table><h3 id=complextan-complextanop><code>complex.tan</code> (complex::TanOp) <a class=headline-hash href=#complextan-complextanop>¶</a></h3><p><em>Computes tangent of a complex number</em></p><p>Syntax:</p><pre tabindex=0><code>operation ::= `complex.tan` $complex (`fastmath` `` $fastmath^)? attr-dict `:` type($complex) </code></pre><p>The <code>tan</code> op takes a single complex number and computes the tangent of it, i.e. <code>tan(x)</code>, where <code>x</code> is the input value.</p><p>Example:</p><div class=highlight><pre tabindex=0 class=chroma><code class=language-mlir data-lang=mlir><span class=line><span class=cl><span class=nv>%a</span> <span class=p>=</span> complex<span class=p>.</span>tan <span class=nv>%b</span> <span class=p>:</span> complex<span class=p><</span><span class=k>f32</span><span class=p>></span> </span></span></code></pre></div><p>Traits: <code>AlwaysSpeculatableImplTrait</code>, <code>Elementwise</code>, <code>SameOperandsAndResultType</code></p><p>Interfaces: <code>ArithFastMathInterface</code>, <code>ConditionallySpeculatable</code>, <code>InferTypeOpInterface</code>, <code>NoMemoryEffect (MemoryEffectOpInterface)</code></p><p>Effects: <code>MemoryEffects::Effect{}</code></p><h4 id=attributes-22>Attributes: <a class=headline-hash href=#attributes-22>¶</a></h4><table><tr><th>Attribute</th><th>MLIR Type</th><th>Description</th></tr><tr><td><code>fastmath</code></td><td>::mlir::arith::FastMathFlagsAttr</td><td><details><summary>Floating point fast math flags</summary><p>Enum cases:</p><ul><li>none (<code>none</code>)</li><li>reassoc (<code>reassoc</code>)</li><li>nnan (<code>nnan</code>)</li><li>ninf (<code>ninf</code>)</li><li>nsz (<code>nsz</code>)</li><li>arcp (<code>arcp</code>)</li><li>contract (<code>contract</code>)</li><li>afn (<code>afn</code>)</li><li>fast (<code>fast</code>)</li></ul></details></td></tr></table><h4 id=operands-25>Operands: <a class=headline-hash href=#operands-25>¶</a></h4><table><thead><tr><th style=text-align:center>Operand</th><th>Description</th></tr></thead><tbody><tr><td style=text-align:center><code>complex</code></td><td>complex type with floating-point elements</td></tr></tbody></table><h4 id=results-26>Results: <a class=headline-hash href=#results-26>¶</a></h4><table><thead><tr><th style=text-align:center>Result</th><th>Description</th></tr></thead><tbody><tr><td style=text-align:center><code>result</code></td><td>complex type with floating-point elements</td></tr></tbody></table><h3 id=complextanh-complextanhop><code>complex.tanh</code> (complex::TanhOp) <a class=headline-hash href=#complextanh-complextanhop>¶</a></h3><p><em>Complex hyperbolic tangent</em></p><p>Syntax:</p><pre tabindex=0><code>operation ::= `complex.tanh` $complex (`fastmath` `` $fastmath^)? attr-dict `:` type($complex) </code></pre><p>The <code>tanh</code> operation takes a complex number and returns its hyperbolic tangent.</p><p>Example:</p><div class=highlight><pre tabindex=0 class=chroma><code class=language-mlir data-lang=mlir><span class=line><span class=cl><span class=nv>%a</span> <span class=p>=</span> complex<span class=p>.</span>tanh <span class=nv>%b</span> <span class=p>:</span> complex<span class=p><</span><span class=k>f32</span><span class=p>></span> </span></span></code></pre></div><p>Traits: <code>AlwaysSpeculatableImplTrait</code>, <code>Elementwise</code>, <code>SameOperandsAndResultType</code></p><p>Interfaces: <code>ArithFastMathInterface</code>, <code>ConditionallySpeculatable</code>, <code>InferTypeOpInterface</code>, <code>NoMemoryEffect (MemoryEffectOpInterface)</code></p><p>Effects: <code>MemoryEffects::Effect{}</code></p><h4 id=attributes-23>Attributes: <a class=headline-hash href=#attributes-23>¶</a></h4><table><tr><th>Attribute</th><th>MLIR Type</th><th>Description</th></tr><tr><td><code>fastmath</code></td><td>::mlir::arith::FastMathFlagsAttr</td><td><details><summary>Floating point fast math flags</summary><p>Enum cases:</p><ul><li>none (<code>none</code>)</li><li>reassoc (<code>reassoc</code>)</li><li>nnan (<code>nnan</code>)</li><li>ninf (<code>ninf</code>)</li><li>nsz (<code>nsz</code>)</li><li>arcp (<code>arcp</code>)</li><li>contract (<code>contract</code>)</li><li>afn (<code>afn</code>)</li><li>fast (<code>fast</code>)</li></ul></details></td></tr></table><h4 id=operands-26>Operands: <a class=headline-hash href=#operands-26>¶</a></h4><table><thead><tr><th style=text-align:center>Operand</th><th>Description</th></tr></thead><tbody><tr><td style=text-align:center><code>complex</code></td><td>complex type with floating-point elements</td></tr></tbody></table><h4 id=results-27>Results: <a class=headline-hash href=#results-27>¶</a></h4><table><thead><tr><th style=text-align:center>Result</th><th>Description</th></tr></thead><tbody><tr><td style=text-align:center><code>result</code></td><td>complex type with floating-point elements</td></tr></tbody></table><h2 id=enums>Enums <a class=headline-hash href=#enums>¶</a></h2><h3 id=cmpfpredicate>CmpFPredicate <a class=headline-hash href=#cmpfpredicate>¶</a></h3><p>allowed 64-bit signless integer cases: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15</p><h4 id=cases>Cases: <a class=headline-hash href=#cases>¶</a></h4><table><thead><tr><th style=text-align:center>Symbol</th><th style=text-align:center>Value</th><th>String</th></tr></thead><tbody><tr><td style=text-align:center>AlwaysFalse</td><td style=text-align:center><code>0</code></td><td>false</td></tr><tr><td style=text-align:center>OEQ</td><td style=text-align:center><code>1</code></td><td>oeq</td></tr><tr><td style=text-align:center>OGT</td><td style=text-align:center><code>2</code></td><td>ogt</td></tr><tr><td style=text-align:center>OGE</td><td style=text-align:center><code>3</code></td><td>oge</td></tr><tr><td style=text-align:center>OLT</td><td style=text-align:center><code>4</code></td><td>olt</td></tr><tr><td style=text-align:center>OLE</td><td style=text-align:center><code>5</code></td><td>ole</td></tr><tr><td style=text-align:center>ONE</td><td style=text-align:center><code>6</code></td><td>one</td></tr><tr><td style=text-align:center>ORD</td><td style=text-align:center><code>7</code></td><td>ord</td></tr><tr><td style=text-align:center>UEQ</td><td style=text-align:center><code>8</code></td><td>ueq</td></tr><tr><td style=text-align:center>UGT</td><td style=text-align:center><code>9</code></td><td>ugt</td></tr><tr><td style=text-align:center>UGE</td><td style=text-align:center><code>10</code></td><td>uge</td></tr><tr><td style=text-align:center>ULT</td><td style=text-align:center><code>11</code></td><td>ult</td></tr><tr><td style=text-align:center>ULE</td><td style=text-align:center><code>12</code></td><td>ule</td></tr><tr><td style=text-align:center>UNE</td><td style=text-align:center><code>13</code></td><td>une</td></tr><tr><td style=text-align:center>UNO</td><td style=text-align:center><code>14</code></td><td>uno</td></tr><tr><td style=text-align:center>AlwaysTrue</td><td style=text-align:center><code>15</code></td><td>true</td></tr></tbody></table><h3 id=cmpipredicate>CmpIPredicate <a class=headline-hash href=#cmpipredicate>¶</a></h3><p>allowed 64-bit signless integer cases: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9</p><h4 id=cases-1>Cases: <a class=headline-hash href=#cases-1>¶</a></h4><table><thead><tr><th style=text-align:center>Symbol</th><th style=text-align:center>Value</th><th>String</th></tr></thead><tbody><tr><td style=text-align:center>eq</td><td style=text-align:center><code>0</code></td><td>eq</td></tr><tr><td style=text-align:center>ne</td><td style=text-align:center><code>1</code></td><td>ne</td></tr><tr><td style=text-align:center>slt</td><td style=text-align:center><code>2</code></td><td>slt</td></tr><tr><td style=text-align:center>sle</td><td style=text-align:center><code>3</code></td><td>sle</td></tr><tr><td style=text-align:center>sgt</td><td style=text-align:center><code>4</code></td><td>sgt</td></tr><tr><td style=text-align:center>sge</td><td style=text-align:center><code>5</code></td><td>sge</td></tr><tr><td style=text-align:center>ult</td><td style=text-align:center><code>6</code></td><td>ult</td></tr><tr><td style=text-align:center>ule</td><td style=text-align:center><code>7</code></td><td>ule</td></tr><tr><td style=text-align:center>ugt</td><td style=text-align:center><code>8</code></td><td>ugt</td></tr><tr><td style=text-align:center>uge</td><td style=text-align:center><code>9</code></td><td>uge</td></tr></tbody></table><h3 id=integeroverflowflags>IntegerOverflowFlags <a class=headline-hash href=#integeroverflowflags>¶</a></h3><p>Integer overflow arith flags</p><h4 id=cases-2>Cases: <a class=headline-hash href=#cases-2>¶</a></h4><table><thead><tr><th style=text-align:center>Symbol</th><th style=text-align:center>Value</th><th>String</th></tr></thead><tbody><tr><td style=text-align:center>none</td><td style=text-align:center><code>0</code></td><td>none</td></tr><tr><td style=text-align:center>nsw</td><td style=text-align:center><code>1</code></td><td>nsw</td></tr><tr><td style=text-align:center>nuw</td><td style=text-align:center><code>2</code></td><td>nuw</td></tr></tbody></table><h3 id=roundingmode>RoundingMode <a class=headline-hash href=#roundingmode>¶</a></h3><p>Floating point rounding mode</p><h4 id=cases-3>Cases: <a class=headline-hash href=#cases-3>¶</a></h4><table><thead><tr><th style=text-align:center>Symbol</th><th style=text-align:center>Value</th><th>String</th></tr></thead><tbody><tr><td style=text-align:center>to_nearest_even</td><td style=text-align:center><code>0</code></td><td>to_nearest_even</td></tr><tr><td style=text-align:center>downward</td><td style=text-align:center><code>1</code></td><td>downward</td></tr><tr><td style=text-align:center>upward</td><td style=text-align:center><code>2</code></td><td>upward</td></tr><tr><td style=text-align:center>toward_zero</td><td style=text-align:center><code>3</code></td><td>toward_zero</td></tr><tr><td style=text-align:center>to_nearest_away</td><td style=text-align:center><code>4</code></td><td>to_nearest_away</td></tr></tbody></table><h3 id=atomicrmwkind>AtomicRMWKind <a class=headline-hash href=#atomicrmwkind>¶</a></h3><p>allowed 64-bit signless integer cases: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14</p><h4 id=cases-4>Cases: <a class=headline-hash href=#cases-4>¶</a></h4><table><thead><tr><th style=text-align:center>Symbol</th><th style=text-align:center>Value</th><th>String</th></tr></thead><tbody><tr><td style=text-align:center>addf</td><td style=text-align:center><code>0</code></td><td>addf</td></tr><tr><td style=text-align:center>addi</td><td style=text-align:center><code>1</code></td><td>addi</td></tr><tr><td style=text-align:center>assign</td><td style=text-align:center><code>2</code></td><td>assign</td></tr><tr><td style=text-align:center>maximumf</td><td style=text-align:center><code>3</code></td><td>maximumf</td></tr><tr><td style=text-align:center>maxs</td><td style=text-align:center><code>4</code></td><td>maxs</td></tr><tr><td style=text-align:center>maxu</td><td style=text-align:center><code>5</code></td><td>maxu</td></tr><tr><td style=text-align:center>minimumf</td><td style=text-align:center><code>6</code></td><td>minimumf</td></tr><tr><td style=text-align:center>mins</td><td style=text-align:center><code>7</code></td><td>mins</td></tr><tr><td style=text-align:center>minu</td><td style=text-align:center><code>8</code></td><td>minu</td></tr><tr><td style=text-align:center>mulf</td><td style=text-align:center><code>9</code></td><td>mulf</td></tr><tr><td style=text-align:center>muli</td><td style=text-align:center><code>10</code></td><td>muli</td></tr><tr><td style=text-align:center>ori</td><td style=text-align:center><code>11</code></td><td>ori</td></tr><tr><td style=text-align:center>andi</td><td style=text-align:center><code>12</code></td><td>andi</td></tr><tr><td style=text-align:center>maxnumf</td><td style=text-align:center><code>13</code></td><td>maxnumf</td></tr><tr><td style=text-align:center>minnumf</td><td style=text-align:center><code>14</code></td><td>minnumf</td></tr></tbody></table><h3 id=fastmathflags>FastMathFlags <a class=headline-hash href=#fastmathflags>¶</a></h3><p>Floating point fast math flags</p><h4 id=cases-5>Cases: <a class=headline-hash href=#cases-5>¶</a></h4><table><thead><tr><th style=text-align:center>Symbol</th><th style=text-align:center>Value</th><th>String</th></tr></thead><tbody><tr><td style=text-align:center>none</td><td style=text-align:center><code>0</code></td><td>none</td></tr><tr><td style=text-align:center>reassoc</td><td style=text-align:center><code>1</code></td><td>reassoc</td></tr><tr><td style=text-align:center>nnan</td><td style=text-align:center><code>2</code></td><td>nnan</td></tr><tr><td style=text-align:center>ninf</td><td style=text-align:center><code>4</code></td><td>ninf</td></tr><tr><td style=text-align:center>nsz</td><td style=text-align:center><code>8</code></td><td>nsz</td></tr><tr><td style=text-align:center>arcp</td><td style=text-align:center><code>16</code></td><td>arcp</td></tr><tr><td style=text-align:center>contract</td><td style=text-align:center><code>32</code></td><td>contract</td></tr><tr><td style=text-align:center>afn</td><td style=text-align:center><code>64</code></td><td>afn</td></tr><tr><td style=text-align:center>fast</td><td style=text-align:center><code>127</code></td><td>fast</td></tr></tbody></table><div class=edit-meta><br></div><nav class=pagination><a class="nav nav-prev" href=https://mlir.llvm.org/docs/Dialects/ControlFlowDialect/ title="'cf' Dialect"><i class="fas fa-arrow-left" aria-hidden=true></i> Prev - 'cf' Dialect</a> <a class="nav nav-next" href=https://mlir.llvm.org/docs/Dialects/DLTIDialect/ title="'dlti' Dialect">Next - 'dlti' Dialect <i class="fas fa-arrow-right" aria-hidden=true></i></a></nav><footer><p class=powered>Powered by <a href=https://gohugo.io>Hugo</a>. Theme by <a href=https://themes.gohugo.io/hugo-theme-techdoc/>TechDoc</a>. Designed by <a href=https://github.com/thingsym/hugo-theme-techdoc>Thingsym</a>.</p></footer></main><div class=sidebar><nav class=slide-menu><ul><li><a href=https://mlir.llvm.org/>Home</a></li><li><a href=https://mlir.llvm.org/users/>Users of MLIR</a></li><li><a href=https://mlir.llvm.org/pubs/>MLIR Related Publications</a></li><li><a href=https://mlir.llvm.org/talks/>Talks</a></li><li><a href=https://mlir.llvm.org/deprecation/>Deprecations & Current Refactoring</a></li><li class=has-sub-menu><a href=https://mlir.llvm.org/getting_started/>Getting Started<span class="mark closed">+</span></a><ul class=sub-menu><li><a href=https://mlir.llvm.org/getting_started/ReportingIssues/>Reporting Issues</a></li><li><a href=https://mlir.llvm.org/getting_started/Debugging/>Debugging Tips</a></li><li><a href=https://mlir.llvm.org/getting_started/Faq/>FAQ</a></li><li><a href=https://mlir.llvm.org/getting_started/Contributing/>How to Contribute</a></li><li><a href=https://mlir.llvm.org/getting_started/DeveloperGuide/>Developer Guide</a></li><li><a href=https://mlir.llvm.org/getting_started/openprojects/>Open Projects</a></li><li><a href=https://mlir.llvm.org/getting_started/Glossary/>Glossary</a></li><li><a href=https://mlir.llvm.org/getting_started/TestingGuide/>Testing Guide</a></li></ul></li><li class="parent has-sub-menu"><a href=https://mlir.llvm.org/docs/>Code Documentation<span class="mark opened">-</span></a><ul class=sub-menu><li class=has-sub-menu><a href=https://mlir.llvm.org/docs/Bindings/>Bindings<span class="mark closed">+</span></a><ul class=sub-menu><li><a href=https://mlir.llvm.org/docs/Bindings/Python/>MLIR Python Bindings</a></li></ul></li><li class=has-sub-menu><a href=https://mlir.llvm.org/docs/Tools/>Tools<span class="mark closed">+</span></a><ul class=sub-menu><li><a href=https://mlir.llvm.org/docs/Tools/MLIRLSP/>MLIR : Language Server Protocol</a></li><li><a href=https://mlir.llvm.org/docs/Tools/mlir-reduce/>MLIR Reduce</a></li><li><a href=https://mlir.llvm.org/docs/Tools/mlir-rewrite/>mlir-rewrite</a></li></ul></li><li><a href=https://mlir.llvm.org/docs/QuantPasses/></a></li><li><a href=https://mlir.llvm.org/docs/ActionTracing/>Action: Tracing and Debugging MLIR-based Compilers</a></li><li><a href=https://mlir.llvm.org/docs/BufferDeallocationInternals/>Buffer Deallocation - Internals</a></li><li><a href=https://mlir.llvm.org/docs/Bufferization/>Bufferization</a></li><li><a href=https://mlir.llvm.org/docs/DataLayout/>Data Layout Modeling</a></li><li class=has-sub-menu><a href=https://mlir.llvm.org/docs/DefiningDialects/>Defining Dialects<span class="mark closed">+</span></a><ul class=sub-menu><li><a href=https://mlir.llvm.org/docs/DefiningDialects/Constraints/>Constraints</a></li><li><a href=https://mlir.llvm.org/docs/DefiningDialects/AttributesAndTypes/>Defining Dialect Attributes and Types</a></li><li><a href=https://mlir.llvm.org/docs/DefiningDialects/Operations/>Operation Definition Specification (ODS)</a></li></ul></li><li><a href=https://mlir.llvm.org/docs/Diagnostics/>Diagnostic Infrastructure</a></li><li><a href=https://mlir.llvm.org/docs/DialectConversion/>Dialect Conversion</a></li><li class="parent has-sub-menu"><a href=https://mlir.llvm.org/docs/Dialects/>Dialects<span class="mark opened">-</span></a><ul class=sub-menu><li><a href=https://mlir.llvm.org/docs/Dialects/DLTITransformOps/></a></li><li><a href=https://mlir.llvm.org/docs/Dialects/OpenACCDialect/>'acc' Dialect</a></li><li><a href=https://mlir.llvm.org/docs/Dialects/Affine/>'affine' Dialect</a></li><li><a href=https://mlir.llvm.org/docs/Dialects/AMDGPU/>'amdgpu' Dialect</a></li><li><a href=https://mlir.llvm.org/docs/Dialects/AMX/>'amx' Dialect</a></li><li><a href=https://mlir.llvm.org/docs/Dialects/ArithOps/>'arith' Dialect</a></li><li><a href=https://mlir.llvm.org/docs/Dialects/ArmNeon/>'arm_neon' Dialect</a></li><li><a href=https://mlir.llvm.org/docs/Dialects/ArmSVE/>'arm_sve' Dialect</a></li><li><a href=https://mlir.llvm.org/docs/Dialects/ArmSME/>'ArmSME' Dialect</a></li><li><a href=https://mlir.llvm.org/docs/Dialects/AsyncDialect/>'async' Dialect</a></li><li><a href=https://mlir.llvm.org/docs/Dialects/BufferizationOps/>'bufferization' Dialect</a></li><li><a href=https://mlir.llvm.org/docs/Dialects/ControlFlowDialect/>'cf' Dialect</a></li><li class=active><a href=https://mlir.llvm.org/docs/Dialects/ComplexOps/>'complex' Dialect</a></li><li><a href=https://mlir.llvm.org/docs/Dialects/DLTIDialect/>'dlti' Dialect</a></li><li><a href=https://mlir.llvm.org/docs/Dialects/EmitC/>'emitc' Dialect</a></li><li><a href=https://mlir.llvm.org/docs/Dialects/Func/>'func' Dialect</a></li><li><a href=https://mlir.llvm.org/docs/Dialects/GPU/>'gpu' Dialect</a></li><li><a href=https://mlir.llvm.org/docs/Dialects/IndexOps/>'index' Dialect</a></li><li><a href=https://mlir.llvm.org/docs/Dialects/IRDL/>'irdl' Dialect</a></li><li class=has-sub-menu><a href=https://mlir.llvm.org/docs/Dialects/Linalg/>'linalg' Dialect<span class="mark closed">+</span></a><ul class=sub-menu><li><a href=https://mlir.llvm.org/docs/Dialects/Linalg/OpDSL/>Linalg OpDSL</a></li></ul></li><li><a href=https://mlir.llvm.org/docs/Dialects/LLVM/>'llvm' Dialect</a></li><li><a href=https://mlir.llvm.org/docs/Dialects/MathOps/>'math' Dialect</a></li><li><a href=https://mlir.llvm.org/docs/Dialects/MemRef/>'memref' Dialect</a></li><li><a href=https://mlir.llvm.org/docs/Dialects/Mesh/>'mesh' Dialect</a></li><li><a href=https://mlir.llvm.org/docs/Dialects/MLProgramOps/>'ml_program' Dialect</a></li><li><a href=https://mlir.llvm.org/docs/Dialects/MPI/>'mpi' Dialect</a></li><li><a href=https://mlir.llvm.org/docs/Dialects/NVGPU/>'nvgpu' Dialect</a></li><li><a href=https://mlir.llvm.org/docs/Dialects/NVVMDialect/>'nvvm' Dialect</a></li><li class=has-sub-menu><a href=https://mlir.llvm.org/docs/Dialects/OpenMPDialect/>'omp' Dialect<span class="mark closed">+</span></a><ul class=sub-menu><li><a href=https://mlir.llvm.org/docs/Dialects/OpenMPDialect/ODS/>ODS Documentation</a></li></ul></li><li><a href=https://mlir.llvm.org/docs/Dialects/PDLInterpOps/>'pdl_interp' Dialect</a></li><li><a href=https://mlir.llvm.org/docs/Dialects/PDLOps/>'pdl' Dialect</a></li><li><a href=https://mlir.llvm.org/docs/Dialects/PolynomialDialect/>'polynomial' Dialect</a></li><li><a href=https://mlir.llvm.org/docs/Dialects/PtrOps/>'ptr' Dialect</a></li><li><a href=https://mlir.llvm.org/docs/Dialects/QuantDialect/>'quant' Dialect</a></li><li><a href=https://mlir.llvm.org/docs/Dialects/ROCDLDialect/>'rocdl' Dialect</a></li><li><a href=https://mlir.llvm.org/docs/Dialects/SCFDialect/>'scf' Dialect</a></li><li><a href=https://mlir.llvm.org/docs/Dialects/ShapeDialect/>'shape' Dialect</a></li><li><a href=https://mlir.llvm.org/docs/Dialects/SparseTensorOps/>'sparse_tensor' Dialect</a></li><li><a href=https://mlir.llvm.org/docs/Dialects/TensorOps/>'tensor' Dialect</a></li><li><a href=https://mlir.llvm.org/docs/Dialects/UBOps/>'ub' Dialect</a></li><li><a href=https://mlir.llvm.org/docs/Dialects/VCIXDialect/>'vcix' Dialect</a></li><li><a href=https://mlir.llvm.org/docs/Dialects/Vector/>'vector' Dialect</a></li><li><a href=https://mlir.llvm.org/docs/Dialects/X86Vector/>'x86vector' Dialect</a></li><li><a href=https://mlir.llvm.org/docs/Dialects/XeGPU/>'xegpu' Dialect</a></li><li><a href=https://mlir.llvm.org/docs/Dialects/Builtin/>Builtin Dialect</a></li><li><a href=https://mlir.llvm.org/docs/Dialects/MatchOpInterfaces/>OpInterface definitions</a></li><li><a href=https://mlir.llvm.org/docs/Dialects/SPIR-V/>SPIR-V Dialect</a></li><li><a href=https://mlir.llvm.org/docs/Dialects/TOSA/>Tensor Operator Set Architecture (TOSA) Dialect</a></li><li><a href=https://mlir.llvm.org/docs/Dialects/Transform/>Transform Dialect</a></li></ul></li><li><a href=https://mlir.llvm.org/docs/Interfaces/>Interfaces</a></li><li><a href=https://mlir.llvm.org/docs/TargetLLVMIR/>LLVM IR Target</a></li><li><a href=https://mlir.llvm.org/docs/BytecodeFormat/>MLIR Bytecode Format</a></li><li><a href=https://mlir.llvm.org/docs/CAPI/>MLIR C API</a></li><li><a href=https://mlir.llvm.org/docs/LangRef/>MLIR Language Reference</a></li><li><a href=https://mlir.llvm.org/docs/ReleaseNotes/>MLIR Release Notes</a></li><li><a href=https://mlir.llvm.org/docs/Canonicalization/>Operation Canonicalization</a></li><li><a href=https://mlir.llvm.org/docs/OwnershipBasedBufferDeallocation/>Ownership-based Buffer Deallocation</a></li><li><a href=https://mlir.llvm.org/docs/PassManagement/>Pass Infrastructure</a></li><li><a href=https://mlir.llvm.org/docs/Passes/>Passes</a></li><li><a href=https://mlir.llvm.org/docs/PatternRewriter/>Pattern Rewriting : Generic DAG-to-DAG Rewriting</a></li><li><a href=https://mlir.llvm.org/docs/PDLL/>PDLL - PDL Language</a></li><li><a href=https://mlir.llvm.org/docs/Quantization/>Quantization</a></li><li class=has-sub-menu><a href=https://mlir.llvm.org/docs/Rationale/>Rationale<span class="mark closed">+</span></a><ul class=sub-menu><li><a href=https://mlir.llvm.org/docs/Rationale/RationaleGenericDAGRewriter/>Generic DAG Rewriter Infrastructure Rationale</a></li><li><a href=https://mlir.llvm.org/docs/Rationale/RationaleLinalgDialect/>Linalg Dialect Rationale: The Case For Compiler-Friendly Custom Operations</a></li><li><a href=https://mlir.llvm.org/docs/Rationale/Rationale/>MLIR Rationale</a></li><li><a href=https://mlir.llvm.org/docs/Rationale/MLIRForGraphAlgorithms/>MLIR: Incremental Application to Graph Algorithms in ML Frameworks</a></li><li><a href=https://mlir.llvm.org/docs/Rationale/RationaleSimplifiedPolyhedralForm/>MLIR: The case for a simplified polyhedral form</a></li><li><a href=https://mlir.llvm.org/docs/Rationale/SideEffectsAndSpeculation/>Side Effects & Speculation</a></li><li><a href=https://mlir.llvm.org/docs/Rationale/UsageOfConst/>Usage of 'const' in MLIR, for core IR types</a></li></ul></li><li><a href=https://mlir.llvm.org/docs/ShapeInference/>Shape Inference</a></li><li><a href=https://mlir.llvm.org/docs/SPIRVToLLVMDialectConversion/>SPIR-V Dialect to LLVM Dialect conversion manual</a></li><li><a href=https://mlir.llvm.org/docs/SymbolsAndSymbolTables/>Symbols and Symbol Tables</a></li><li><a href=https://mlir.llvm.org/docs/DeclarativeRewrites/>Table-driven Declarative Rewrite Rule (DRR)</a></li><li class=has-sub-menu><a href=https://mlir.llvm.org/docs/Traits/>Traits<span class="mark closed">+</span></a><ul class=sub-menu><li><a href=https://mlir.llvm.org/docs/Traits/Broadcastable/>The `Broadcastable` Trait</a></li></ul></li><li class=has-sub-menu><a href=https://mlir.llvm.org/docs/Tutorials/>Tutorials<span class="mark closed">+</span></a><ul class=sub-menu><li><a href=https://mlir.llvm.org/docs/Tutorials/CreatingADialect/>Creating a Dialect</a></li><li><a href=https://mlir.llvm.org/docs/Tutorials/QuickstartRewrites/>Quickstart tutorial to adding MLIR graph rewrite</a></li><li class=has-sub-menu><a href=https://mlir.llvm.org/docs/Tutorials/Toy/>Toy Tutorial<span class="mark closed">+</span></a><ul class=sub-menu><li><a href=https://mlir.llvm.org/docs/Tutorials/Toy/Ch-1/>Chapter 1: Toy Language and AST</a></li><li><a href=https://mlir.llvm.org/docs/Tutorials/Toy/Ch-2/>Chapter 2: Emitting Basic MLIR</a></li><li><a href=https://mlir.llvm.org/docs/Tutorials/Toy/Ch-3/>Chapter 3: High-level Language-Specific Analysis and Transformation</a></li><li><a href=https://mlir.llvm.org/docs/Tutorials/Toy/Ch-4/>Chapter 4: Enabling Generic Transformation with Interfaces</a></li><li><a href=https://mlir.llvm.org/docs/Tutorials/Toy/Ch-5/>Chapter 5: Partial Lowering to Lower-Level Dialects for Optimization</a></li><li><a href=https://mlir.llvm.org/docs/Tutorials/Toy/Ch-6/>Chapter 6: Lowering to LLVM and CodeGeneration</a></li><li><a href=https://mlir.llvm.org/docs/Tutorials/Toy/Ch-7/>Chapter 7: Adding a Composite Type to Toy</a></li></ul></li><li class=has-sub-menu><a href=https://mlir.llvm.org/docs/Tutorials/transform/>Transform Dialect Tutorial<span class="mark closed">+</span></a><ul class=sub-menu><li><a href=https://mlir.llvm.org/docs/Tutorials/transform/Ch0/>Chapter 0: A Primer on “Structured” Linalg Operations</a></li><li><a href=https://mlir.llvm.org/docs/Tutorials/transform/Ch1/>Chapter 1: Combining Existing Transformations</a></li><li><a href=https://mlir.llvm.org/docs/Tutorials/transform/Ch2/>Chapter 2: Adding a Simple New Transformation Operation</a></li><li><a href=https://mlir.llvm.org/docs/Tutorials/transform/Ch3/>Chapter 3: More than Simple Transform Operations</a></li><li><a href=https://mlir.llvm.org/docs/Tutorials/transform/Ch4/>Chapter 4: Matching Payload with Transform Operations</a></li><li><a href=https://mlir.llvm.org/docs/Tutorials/transform/ChH/>Chapter H: Reproducing Halide Schedule</a></li></ul></li><li><a href=https://mlir.llvm.org/docs/Tutorials/UnderstandingTheIRStructure/>Understanding the IR Structure</a></li><li><a href=https://mlir.llvm.org/docs/Tutorials/MlirOpt/>Using `mlir-opt`</a></li><li><a href=https://mlir.llvm.org/docs/Tutorials/DataFlowAnalysis/>Writing DataFlow Analyses in MLIR</a></li></ul></li></ul></li></ul></nav><div class=sidebar-footer></div></div></div><a href=# id=backtothetop-fixed class=backtothetop data-backtothetop-duration=600 data-backtothetop-easing=easeOutQuart data-backtothetop-fixed-fadein=1000 data-backtothetop-fixed-fadeout=1000 data-backtothetop-fixed-bottom=10 data-backtothetop-fixed-right=20><span class="fa-layers fa-fw"><i class="fas fa-circle"></i> <i class="fas fa-arrow-circle-up"></i></span></a></div></body></html>