This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Add & use `hasNamedOperand`, NFC
ClosedPublic

Authored by Pierre-vh on Nov 7 2022, 3:54 AM.

Details

Summary

In a lot of places, we were just calling getNamedOperandIdx to check if the result was != or == to -1.
This is fine in itself, but it's verbose and doesn't make the intention clear, IMHO. I added a hasNamedOperand and replaced all cases I could find with regexes and manually.

Diff Detail

Event Timeline

Pierre-vh created this revision.Nov 7 2022, 3:54 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 7 2022, 3:54 AM
Pierre-vh requested review of this revision.Nov 7 2022, 3:54 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 7 2022, 3:54 AM
Pierre-vh planned changes to this revision.Nov 7 2022, 4:03 AM
Pierre-vh updated this revision to Diff 473618.Nov 7 2022, 4:14 AM

Fix additional cases

Pierre-vh edited the summary of this revision. (Show Details)Nov 7 2022, 4:14 AM
foad accepted this revision.Nov 7 2022, 5:55 AM

The principle LGTM. I have not read the whole patch.

This revision is now accepted and ready to land.Nov 7 2022, 5:55 AM
arsenm accepted this revision.Nov 7 2022, 8:26 AM
This revision was landed with ongoing or failed builds.Nov 7 2022, 11:57 PM
This revision was automatically updated to reflect the committed changes.