Page MenuHomePhabricator

Please use GitHub pull requests for new patches. Avoid migrating existing patches. Phabricator shutdown timeline

[GlobalISel][RISCV][TableGen] Teach GlobalISelEmitter about HwMode.

Authored by craig.topper on Aug 23 2023, 12:05 PM.



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

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

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.

Diff Detail

Event Timeline

craig.topper created this revision.Aug 23 2023, 12:05 PM
craig.topper requested review of this revision.Aug 23 2023, 12:05 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 23 2023, 12:05 PM
Herald added subscribers: wangpc, eopXD, wdng. · View Herald Transcript
arsenm accepted this revision.Aug 23 2023, 5:08 PM
arsenm added inline comments.


This revision is now accepted and ready to land.Aug 23 2023, 5:08 PM
craig.topper added inline comments.Aug 23 2023, 6:22 PM

Would that cause non-determinism on the output of the loops in emitSubtargetFeatureBitEnumeration and emitComputeAvailableFeatures?

arsenm added inline comments.Aug 23 2023, 6:29 PM

Yes I think so