This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Replace OperandMatchResultTy with ParseStatus (NFC)
ClosedPublic

Authored by barannikov88 on Jul 1 2023, 7:07 PM.

Details

Summary

ParseStatus is slightly more convenient to use due to implicit
conversion from bool, which allows to do something like:

return Error(L, "msg");

when with MatchOperandResultTy it had to be:

Error(L, "msg");
return MatchOperand_ParseFail;

It also has more appropriate name since parse* methods are not only for
parsing operands.

Diff Detail

Event Timeline

barannikov88 created this revision.Jul 1 2023, 7:07 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 1 2023, 7:07 PM
barannikov88 requested review of this revision.Jul 1 2023, 7:07 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 1 2023, 7:07 PM

There are a few more invocations of OperandMatchResultTy in SIInstrInfo.td.

Update SIInstrInfo.td

There are a few more invocations of OperandMatchResultTy in SIInstrInfo.td.

Thanks, updated.

kosarev accepted this revision.Jul 2 2023, 12:44 AM

LGTM. Thanks for the clean-up!

Ideally, it would be nice to have AsmMatcherEmitter.cpp updated as well before submitting this.

xref: https://reviews.llvm.org/D154101

This revision is now accepted and ready to land.Jul 2 2023, 12:44 AM

LGTM. Thanks for the clean-up!

Ideally, it would be nice to have AsmMatcherEmitter.cpp updated as well before submitting this.

xref: https://reviews.llvm.org/D154101

I was planning to update AsmMatcherEmitter.cpp after all targets migrated, but it can be done before, too. Will do.