This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Better handling for bit groups in enum parser/printer
ClosedPublic

Authored by rriddle on Oct 22 2022, 2:15 PM.

Details

Summary

We currently wrap all multi-bit cases with a string, but this is
overly restrictive. This commit refactors to use keywords when
we know they are valid, and only degrade to string when the validity
of the bitgroup is unknown.

Diff Detail

Event Timeline

rriddle created this revision.Oct 22 2022, 2:15 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 22 2022, 2:15 PM
rriddle requested review of this revision.Oct 22 2022, 2:15 PM
rriddle updated this revision to Diff 469943.Oct 22 2022, 4:29 PM
Mogball accepted this revision.Oct 22 2022, 11:38 PM
Mogball added inline comments.
mlir/tools/mlir-tblgen/EnumsGen.cpp
143

Why not SmallVector?

146

nit: I feel like !llvm::has_single_bit should come before test

This revision is now accepted and ready to land.Oct 22 2022, 11:38 PM
This revision was automatically updated to reflect the committed changes.
rriddle marked 2 inline comments as done.