This is an archive of the discontinued LLVM Phabricator instance.

[TTI] NFC: Change getCmpSelInstrCost to return InstructionCost
ClosedPublic

Authored by sdesmalen on Apr 9 2021, 8:10 AM.

Details

Summary

This patch migrates the TTI cost interfaces to return an InstructionCost.

See this patch for the introduction of the type: https://reviews.llvm.org/D91174
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2020-November/146408.html

Diff Detail

Event Timeline

sdesmalen created this revision.Apr 9 2021, 8:10 AM
sdesmalen requested review of this revision.Apr 9 2021, 8:10 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 9 2021, 8:10 AM
dmgreen added inline comments.
llvm/include/llvm/CodeGen/BasicTTIImpl.h
2066

This doesn't need the getValue() now, I think?

llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp
1273

This too.

llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp
165 ↗(On Diff #336466)

Merge gone off?

llvm/lib/Target/X86/X86TargetTransformInfo.cpp
3723

This one was already converted to an InstructionCost too.

sdesmalen updated this revision to Diff 336776.Apr 12 2021, 1:44 AM
sdesmalen marked 4 inline comments as done.

Addressed review comments.

llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp
165 ↗(On Diff #336466)

Yes, good catch. I've done a fair bit of rebasing of these patches, this one seems to have slipped through the cracks :)

llvm/lib/Target/X86/X86TargetTransformInfo.cpp
3723

Thanks for pointing out, I'll try to be a bit more diligent with my other patches to spot these cases early!

dmgreen accepted this revision.Apr 12 2021, 3:45 AM

Thanks. LGTM

This revision is now accepted and ready to land.Apr 12 2021, 3:45 AM