[PATCH] D158660: [GlobalISel][RISCV][TableGen] Teach GlobalISelEmitter about HwMode.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 23 12:05:27 PDT 2023


craig.topper created this revision.
craig.topper added reviewers: arsenm, dsanders, aemerson, paquette, nitinjohnraj, kparzysz, qcolombet.
Herald added subscribers: jobnoorman, sunshaoce, VincentWu, vkmr, luismarques, sameer.abuasal, s.egerton, Jim, benna, psnobl, rogfer01, mgrang, shiva0217, kito-cheng, simoncook, arichardson.
Herald added a project: All.
craig.topper requested review of this revision.
Herald added subscribers: wangpc, eopXD, wdng.
Herald added a project: LLVM.

Similar to SelectionDAG, this patch treats HwMode as an additional
predicate that needs to be satisfied for GIM_CheckFeatures.

The existing predicate passes around Record * that point to predicate
objects. While HwMode expansion creates a string that needs to be
checked.

Each HwMode predicate string is uniqued by a new map that assigns
it an index. Each Rule stores the index, or -1 if HwMode doesn't
apply.

The HwMode indices each create a new Predicate feature bit and the
check string from the HwMode is used to set the feature bit.
GIM_CheckFeatures is emitted when the rule has Predicates or the HwModeIdx
is not -1.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D158660

Files:
  llvm/utils/TableGen/GlobalISelEmitter.cpp
  llvm/utils/TableGen/GlobalISelMatchTable.cpp
  llvm/utils/TableGen/GlobalISelMatchTable.h
  llvm/utils/TableGen/GlobalISelMatchTableExecutorEmitter.cpp
  llvm/utils/TableGen/GlobalISelMatchTableExecutorEmitter.h
  llvm/utils/TableGen/SubtargetFeatureInfo.cpp
  llvm/utils/TableGen/SubtargetFeatureInfo.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D158660.552843.patch
Type: text/x-patch
Size: 12769 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230823/50692a8f/attachment.bin>


More information about the llvm-commits mailing list