This is an archive of the discontinued LLVM Phabricator instance.

[docs][GlobalISel]Adding info for G_JUMP_TABLE generic opcode
ClosedPublic

Authored by pooja2299 on Aug 6 2021, 2:52 AM.

Details

Summary

Added description of jump table and G_JUMP_TABLE opcode.

Diff Detail

Event Timeline

pooja2299 created this revision.Aug 6 2021, 2:52 AM
pooja2299 requested review of this revision.Aug 6 2021, 2:52 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 6 2021, 2:52 AM

Added some stylistic nits.

llvm/docs/GlobalISel/GenericOpcode.rst
825–834

Maybe a little more concise?

826
  • Maybe split this sentence up?
  • I don't think parens are necessary here.
829
  • Remind the reader about what "it" is
  • Noun-ify G_BRJT

Updated with required changes with sentences of the G_JUMP_TABLE documentation.

Added some stylistic nits.

Thanks for reviewing. If any other changes are required I would be happy to change.

Did some git archaeology to give some better feedback. :)

llvm/docs/GlobalISel/GenericOpcode.rst
833

When it's a pointer, we should use pN, where N is the address space.

I think 0 is the default, so you can probably just use that.

835

I took a look at the commit that added G_JUMP_TABLE to GenericOpcodes.td (d133c1592560edb77958492a77e4e871b21a9d52)

The message says:

[GlobalISel] Add a G_JUMP_TABLE opcode.

This opcode generates a pointer to the address of the jump table
specified by the source operand, which is a jump table index.

It will be used in conjunction with an upcoming G_BRJT opcode to support
jump table codegen with GlobalISel.

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

So I think that we should basically use that description here. :)

pooja2299 added inline comments.Aug 14 2021, 11:11 PM
llvm/docs/GlobalISel/GenericOpcode.rst
833

ok sure

835

ok will do that

pooja2299 updated this revision to Diff 366861.Aug 17 2021, 4:47 AM

Improved the description of G_JUMP_TABLE

This revision is now accepted and ready to land.Aug 17 2021, 9:38 AM
xgupta added a subscriber: xgupta.Aug 17 2021, 10:19 AM
xgupta added inline comments.
llvm/docs/GlobalISel/GenericOpcode.rst
836

minor nit: I think "Source operand must be a jump table index." seems redundant here as you already said above "The source operand is a jump table index."

pooja2299 updated this revision to Diff 367521.Aug 19 2021, 8:59 AM

Removed the redundant line.

aemerson accepted this revision.Aug 19 2021, 5:00 PM
aemerson added inline comments.
llvm/docs/GlobalISel/GenericOpcode.rst
826–827

I don't think this sentence really fits in this doc. If the user doesn't know what a jump table is then it's better to go read about it in a more detailed source that here. Otherwise, LGTM.

pooja2299 updated this revision to Diff 368121.Aug 23 2021, 8:44 AM

updated with requiredd minor changes

xgupta accepted this revision.Aug 29 2021, 10:23 AM