Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions llvm/utils/TableGen/Common/CodeGenInstAlias.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,10 @@ static Expected<ResultOperand> matchSimpleOperand(const Init *Arg,
// Match 'RegClass:$name' or 'RegOp:$name'.
if (const Record *ArgRC = T.getInitValueAsRegClassLike(Arg)) {
if (ArgRC->isSubClassOf("RegisterClass")) {
if (!T.getRegisterClass(OpRC).hasSubClass(&T.getRegisterClass(ArgRC)))
if (!OpRC->isSubClassOf("RegisterClass") ||
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe instead if (OpRC->isSubclassOf("RegClassByHwMode")) then report "HwMode support is not implemented"?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that would give slightly better results but may be too restrictive. It does seem to work with HWModes as long as the RegClassByHwMode argument is the same, but it doesn't handle the subset case.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have some follow-up changes to improve this (printing essentially what you suggested) including a test.

!T.getRegisterClass(OpRC).hasSubClass(&T.getRegisterClass(ArgRC)))
return createStringError(
"argument register class" + ArgRC->getName() +
"argument register class " + ArgRC->getName() +
" is not a subclass of operand register class " +
OpRC->getName());
if (!ArgName)
Expand Down
Loading