[llvm] 460d220 - [doc]Added examples for generic opcodes

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


Author: pooja2299
Date: 2021-07-31T00:44:32+05:30
New Revision: 460d220872183cdf0ae5114aeac904d12c49931a

URL: https://github.com/llvm/llvm-project/commit/460d220872183cdf0ae5114aeac904d12c49931a
DIFF: https://github.com/llvm/llvm-project/commit/460d220872183cdf0ae5114aeac904d12c49931a.diff

LOG: [doc]Added examples for generic opcodes

Added examples to G_BR, G_BRCOND, G_BRJT, G_BRINDIRECT

Differential Revision: https://reviews.llvm.org/D104974

Added: 
    

Modified: 
    llvm/docs/GlobalISel/GenericOpcode.rst

Removed: 
    


################################################################################
diff  --git a/llvm/docs/GlobalISel/GenericOpcode.rst b/llvm/docs/GlobalISel/GenericOpcode.rst
index dfd57bc4e655b..e17389a7ed5c5 100644
--- a/llvm/docs/GlobalISel/GenericOpcode.rst
+++ b/llvm/docs/GlobalISel/GenericOpcode.rst
@@ -290,7 +290,9 @@ These each perform their respective integer arithmetic on a scalar.
 
 .. 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 @@ Implement the φ node in the SSA graph representing the function.
 
 .. 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
 ^^^^^^^^^^^^
 


        


More information about the llvm-commits mailing list