[PATCH] D104974: [doc]Added examples for generic opcodes

PoojaYadav via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 30 12:15:39 PDT 2021


This revision was automatically updated to reflect the committed changes.
Closed by commit rG460d22087218: [doc]Added examples for generic opcodes (authored by pooja2299).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D104974/new/

https://reviews.llvm.org/D104974

Files:
  llvm/docs/GlobalISel/GenericOpcode.rst


Index: llvm/docs/GlobalISel/GenericOpcode.rst
===================================================================
--- llvm/docs/GlobalISel/GenericOpcode.rst
+++ llvm/docs/GlobalISel/GenericOpcode.rst
@@ -290,7 +290,9 @@
 
 .. code-block:: none
 
-  %2:_(s32) = G_ADD %0:_(s32), %1:_(s32)
+  %dst:_(s32) = G_ADD %src0:_(s32), %src1:_(s32)
+
+The above exmaple adds %src1 to %src0 and stores the result in %dst.
 
 G_SDIVREM, G_UDIVREM
 ^^^^^^^^^^^^^^^^^^^^
@@ -755,28 +757,40 @@
 
 .. code-block:: none
 
-  %1(s8) = G_PHI %7(s8), %bb.0, %3(s8), %bb.1
+  %dst(s8) = G_PHI %src1(s8), %bb.<id1>, %src2(s8), %bb.<id2>
 
 G_BR
 ^^^^
 
 Unconditional branch
 
+.. code-block:: none
+  G_BR %bb.<id>
+
 G_BRCOND
 ^^^^^^^^
 
 Conditional branch
 
+.. code-block:: none
+  G_BRCOND %condition, %basicblock.<id>
+
 G_BRINDIRECT
 ^^^^^^^^^^^^
 
 Indirect branch
 
+.. code-block:: none
+  G_BRINDIRECT %src(p0)
+
 G_BRJT
 ^^^^^^
 
 Indirect branch to jump table entry
 
+.. code-block:: none
+  G_BRJT %ptr(p0), %jti, %idx(s64)
+
 G_JUMP_TABLE
 ^^^^^^^^^^^^
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D104974.363182.patch
Type: text/x-patch
Size: 1049 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210730/f003f922/attachment.bin>


More information about the llvm-commits mailing list