[PATCH] D107630: [docs][GlobalISel]Adding info for G_JUMP_TABLE generic opcode

PoojaYadav via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 6 02:52:10 PDT 2021


pooja2299 created this revision.
pooja2299 added reviewers: gandhi21299, kbarton, aemerson, paquette, arsenm.
Herald added a subscriber: rovka.
pooja2299 requested review of this revision.
Herald added subscribers: llvm-commits, wdng.
Herald added a project: LLVM.

Added description of jump table and G_JUMP_TABLE opcode.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D107630

Files:
  llvm/docs/GlobalISel/GenericOpcode.rst


Index: llvm/docs/GlobalISel/GenericOpcode.rst
===================================================================
--- llvm/docs/GlobalISel/GenericOpcode.rst
+++ llvm/docs/GlobalISel/GenericOpcode.rst
@@ -798,9 +798,21 @@
 G_JUMP_TABLE
 ^^^^^^^^^^^^
 
-.. caution::
+This generic jump table opcode generates a pointer to the address of the jump 
+table specified by the source operand, which is a jump table index. (A jump 
+table is an array of addresses the CPU should jump to based on certain 
+conditions.)
+It can be used in conjunction with G_BRJT opcode to support jump table codegen 
+with GlobalISel.
+
+.. code-block:: none
+
+  %dst:_(s32) = G_JUMP_TABLE %jump-table.0
+
+The above example shows assignment of pointer to jump table of given index.
+Source operand must be a jump table index.
+Destination operand must have a pointer type. 
 
-  I found no documentation for this instruction at the time of writing.
 
 G_INTRINSIC, G_INTRINSIC_W_SIDE_EFFECTS
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D107630.364736.patch
Type: text/x-patch
Size: 1009 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210806/a8866df5/attachment.bin>


More information about the llvm-commits mailing list