This is an archive of the discontinued LLVM Phabricator instance.

Avoid appending Pass where already present.
Needs ReviewPublic

Authored by jpienaar on Nov 14 2020, 9:55 AM.

Details

Reviewers
rriddle
Summary

Avoid PassPass cases by not blindly appending Pass. Currently pass definitions
in ODS either end or don't with Pass. This is contrary to Ops & Attr (Types are
inconsistent in this regard) where Op and Attr are appended to the name. Change
the PassGen behavior to not append 'Pass' again this avoids 'PassPass' suffix
(which I can't think where we'd need) and we can update naming to be consistent
incrementally.

Diff Detail

Event Timeline

jpienaar created this revision.Nov 14 2020, 9:55 AM
jpienaar requested review of this revision.Nov 14 2020, 9:55 AM

Seems like a "hack" to me, why not fix the source?

Seems like a "hack" to me, why not fix the source?

Ops & attrs have Op and Attr as suffix, I want Pass definition to behave the same. This is only a hack in that it doesn't enforce or flag an error if you don't end a pass description with Pass in the def name. The fix in the source is to go append Pass everywhere, but then with the existing code you'd get registerXPassPass which is what this is addressing. Post this yes we can fix the source and not have registerXPassPass for def XPass : Pass.

I'm not sure if you're saying that the desired end state is to add a Pass suffix or not?
Either way, why not just implement the desired end-state immediately?

I'm not sure if you're saying that the desired end state is to add a Pass suffix or not?

The desired end state is to add a Pass suffix always.

Either way, why not just implement the desired end-state immediately?

That is a mechanical change that could be done with sed. I can add it in along with this, but I felt it would obscure the code change and so I had though of doing that as a follow up instead. But I can also add it in along with this change. Up to you.

Yes I prefer to keep the code base in a uniform state as much as possible, thanks!

Yes I prefer to keep the code base in a uniform state as much as possible, thanks!

+1. This cleanup seems like it would be small enough to just do it outright.