Files
clang-p2996/llvm/utils/TableGen/SubtargetFeatureInfo.cpp
Craig Topper 8b82ae0b8d [GlobalISel][RISCV][TableGen] Teach GlobalISelEmitter about HwMode.
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
records. 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.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D158660
2023-08-23 21:14:16 -07:00

6.5 KiB