This is an archive of the discontinued LLVM Phabricator instance.

[Codegen][NFC] Replace 'RegisterRegAlloc::FunctionPassCtor' with 'RegisterRegAllocBase<T>::FunctionPassCtor' .
ClosedPublic

Authored by Jimerlife on Feb 28 2023, 11:10 PM.

Details

Summary

Use RegisterRegAllocBase<T>::FunctionPassCtor to construct RegisterRegAllocBase<T>::Registry maybe more proper.

Diff Detail

Event Timeline

Jimerlife created this revision.Feb 28 2023, 11:10 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 28 2023, 11:10 PM
Jimerlife requested review of this revision.Feb 28 2023, 11:10 PM

Out of curiosity - what motivated this change? Do you have dependent patches you're developing or did a linter recommend it?

Out of curiosity - what motivated this change? Do you have dependent patches you're developing or did a linter recommend it?

RegisterRegAlloc, SGPRRegisterRegAlloc and VGPRRegisterRegAlloc are all subclass of RegisterRegAllocBase. There will be construct three Registry, like RegisterRegAllocBase<RegisterRegAlloc>::Registry, RegisterRegAllocBase<SGPRRegisterRegAlloc>::Registry, RegisterRegAllocBase<VGPRRegisterRegAlloc>::Registry. So, I think it is more appropriate to use the FunctionPassCtor of the parent class to replace the FunctionPassCtor of the child class(RegisterRegAlloc).

arsenm accepted this revision.Mar 4 2023, 2:10 PM

Don't see any real difference here

This revision is now accepted and ready to land.Mar 4 2023, 2:10 PM
This revision was landed with ongoing or failed builds.Mar 9 2023, 6:31 PM
This revision was automatically updated to reflect the committed changes.