This is an archive of the discontinued LLVM Phabricator instance.

[TableGen] Fix sub-operand counting bug in PseudoLoweringEmitter
AbandonedPublic

Authored by barannikov88 on Oct 22 2022, 9:04 AM.

Details

Summary

When generating expansion for instruction with complex operands, the
BaseIdx variable was not properly updated. This resulted in
spurious error messages about mismatched operands.
The reworked algorithm simply walks through operands mapping their
logical indices into MI indices.

Diff Detail

Event Timeline

barannikov88 created this revision.Oct 22 2022, 9:04 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 22 2022, 9:04 AM
barannikov88 requested review of this revision.Oct 22 2022, 9:04 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 22 2022, 9:04 AM
barannikov88 added inline comments.Oct 22 2022, 9:05 AM
llvm/utils/TableGen/PseudoLoweringEmitter.cpp
125

Copied from here.

barannikov88 planned changes to this revision.Oct 22 2022, 9:07 AM

OK, this does not work. This triggers assert(BaseIdx == 0 && "Named subargument in pseudo expansion?!"); in some cases. Need to dive deeper into this indexing logic.

Simplify operand index calculation

barannikov88 edited the summary of this revision. (Show Details)Oct 22 2022, 1:10 PM
barannikov88 added reviewers: sepavloff, foad, jyknight.
barannikov88 added inline comments.
llvm/utils/TableGen/PseudoLoweringEmitter.cpp
125

The comment is no longer relevant.

barannikov88 abandoned this revision.Dec 16 2022, 9:51 AM

Abandoning as no one seems to be interested, and it is no longer relevant for our target.