This is an archive of the discontinued LLVM Phabricator instance.

[Metarenamer] Use 'inst' as default name for instructions
ClosedPublic

Authored by mkazantsev on Feb 14 2023, 4:51 AM.

Details

Summary

Currently we use 'tmp', which is also a keyword for FileCheck. It leads to this
annoying warning whenever a script for auto-generation of checks is used.
It is especially annoying that it happens to every test affected by metarenamer.

Just use another prefix for metarenamed names to avoid this.

Diff Detail

Event Timeline

mkazantsev created this revision.Feb 14 2023, 4:51 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 14 2023, 4:51 AM
mkazantsev requested review of this revision.Feb 14 2023, 4:51 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 14 2023, 4:51 AM
mkazantsev edited the summary of this revision. (Show Details)Feb 14 2023, 4:52 AM
nikic added a comment.Feb 14 2023, 5:55 AM

InstNamer uses the i prefix, so maybe follow that lead?

nikic added a comment.Feb 14 2023, 5:56 AM

See dd54432a0f5a6f042fa4d2db3094c6f02e5ad275 for the corresponding InstNamer change.

mkazantsev added a comment.EditedFeb 14 2023, 8:40 AM

InstNamer uses the i prefix, so maybe follow that lead?

It'll create confusion with types like i32. I.e. just from human-readability perspective, it'd blow my mind.

FWIW, I now regret using "i" when I updated InstNamer because i,l,1 are all starting to blur together with age. :)
How about "inst" for both? That's the common short form for an Instruction.

mkazantsev retitled this revision from [Metarenamer] Use 'val' as default name for instructions to [Metarenamer] Use 'inst' as default name for instructions.

inst sounds good to me.

nikic accepted this revision.Feb 14 2023, 11:44 PM

LGTM

A thought I had is that we could also use the name of the instruction, producing something like %phi1 = phi i32 [ ... ]. This is something I often end up doing when manually cleaning up names. That makes things easier to follow than just numbering all instructions.

This revision is now accepted and ready to land.Feb 14 2023, 11:44 PM

LGTM

A thought I had is that we could also use the name of the instruction, producing something like %phi1 = phi i32 [ ... ]. This is something I often end up doing when manually cleaning up names. That makes things easier to follow than just numbering all instructions.

I'd also do it for loop headers and other stuff. Will do as a follow-up.

This revision was landed with ongoing or failed builds.Feb 15 2023, 12:36 AM
This revision was automatically updated to reflect the committed changes.