[PATCH] D71191: [TableGen] Add bang-operators !getop and !setop.

Nicolai Hähnle via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 11 04:00:03 PST 2019


nhaehnle accepted this revision.
nhaehnle added a comment.
This revision is now accepted and ready to land.

Okay, digging in further, the feature is actually used quite a bit in pattern definitions like:

  def : GCNPat <
    (VGPRImm<(i32 imm)>:$imm),
    (V_MOV_B32_e32 imm:$imm)
  >;

or

  def: Pat<(s32_0ImmPred:$s16), (A2_tfrsi imm:$s16)>;

The first really ought to be expressible by placing the `$imm` inside the inner DAG expression, but for some reason the TableGen backend doesn't allow that. I don't know about the second... maybe if it was wrapped as `(i32 s32_0ImmPred:$s16)`? Fundamentally, the feature seems to be used as a hacky workaround for the fact that SelectionDAG patterns don't have an "outer" DAG, and having a naked expression like `s32_0ImmPred:$s16` is not possible.

So here we are. I think your change is okay as-is though. It strips such names, but this naming feature seems kind of awkward to me anyway, and its use should probably be discouraged.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71191





More information about the llvm-commits mailing list