This is an archive of the discontinued LLVM Phabricator instance.

[TTI] Change new getVectorInstrCost overload to use const reference after D131114
ClosedPublic

Authored by MaskRay on Aug 4 2022, 1:26 PM.

Details

Summary

A const reference is preferred over a non-null const pointer.
Type * is kept as is to match the other overload.

Diff Detail

Event Timeline

MaskRay created this revision.Aug 4 2022, 1:26 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 4 2022, 1:26 PM
MaskRay requested review of this revision.Aug 4 2022, 1:26 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 4 2022, 1:26 PM

Thanks for the change! Mostly LGTM.

For my information, any particular reason that a const reference is preferred over a pointer here?
It's true that raw pointers makes ownership unclear, yet they are not uncommon in the codebase. https://llvm.org/docs/ProgrammersManual.html doesn't seem to mention this either.

A small heads-up, i'm having D128302 but I could wait for const reference change if we decide to proceed with this.

davidxl accepted this revision.Aug 4 2022, 3:11 PM

lgtm

This revision is now accepted and ready to land.Aug 4 2022, 3:11 PM
This revision was landed with ongoing or failed builds.Aug 4 2022, 3:16 PM
This revision was automatically updated to reflect the committed changes.