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

PoojaYadav via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 28 10:47:59 PDT 2021


pooja2299 added a comment.

In D104974#2844469 <https://reviews.llvm.org/D104974#2844469>, @paquette wrote:

> I think that @xgupta's suggestions are a good idea. I would recommend changing any unnamed vregs (e.g. `%0`, `%2`, etc.) to named values.
>
> `llvm/include/llvm/Target/GenericOpcodes.td` has the source for these. There operand lists may have some more descriptive names that you can reuse. E.g.:
>
>   // Generic branch to jump table entry
>   def G_BRJT : GenericInstruction {
>     let OutOperandList = (outs);
>     let InOperandList = (ins ptype0:$tbl, unknown:$jti, type1:$idx);
>     let hasSideEffects = false;
>     let isBranch = true;
>     let isTerminator = true;
>     let isBarrier = true;
>     let isIndirectBranch = true;
>   }
>
> The input names here aren't //super// descriptive, but they give a better hint than what we have right now.

Thanks a lot! This was very helpful.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104974



More information about the llvm-commits mailing list