This is an archive of the discontinued LLVM Phabricator instance.

NFC: The Cost Model specialization
ClosedPublic

Authored by avt77 on Oct 3 2016, 6:45 AM.

Details

Summary

The current Cost Model implementation is very inaccurate and has to be updated, improved, re-implemented to be able to take into account the concrete CPU models and the concrete targets where this Cost Model is being used. For example, the Latency Cost Model should be differ from Code Size Cost Model, etc.
This patch is the first step to launch the developing and implementation of a new Cost Model generation.

Diff Detail

Repository
rL LLVM

Event Timeline

avt77 updated this revision to Diff 73269.Oct 3 2016, 6:45 AM
avt77 retitled this revision from to NFC: The Cost Model specialization.
avt77 updated this object.
avt77 added reviewers: RKSimon, spatel, ABataev.
RKSimon added inline comments.Oct 3 2016, 9:35 AM
lib/Target/X86/X86TargetTransformInfo.cpp
16 ↗(On Diff #73269)

following

20 ↗(On Diff #73269)

Is it worth actually including a table showing the equivalences?

Subtarget.hasSSE42() - Nehalem (or better)
Subtarget.hasSSE41() - Penryn (or better)
Subtarget.hasSSE3() - Pentium4 / Athlon64 (or better)

22 ↗(On Diff #73269)

Change this part to a TODO?

avt77 updated this revision to Diff 73603.Oct 5 2016, 1:46 AM

NFC updated accordingly to Simon Pilgrim suggestions.

RKSimon accepted this revision.Oct 9 2016, 7:28 AM
RKSimon edited edge metadata.

LGTM - does anyone else have any issue with making this explicit to help standardize cost values?

lib/Target/X86/X86TargetTransformInfo.cpp
26 ↗(On Diff #73603)

AVX - Sandy Bridge / Jaguar

34 ↗(On Diff #73603)

Pentium2 didn't support SSE instructions

This revision is now accepted and ready to land.Oct 9 2016, 7:28 AM
mkuper edited edge metadata.Oct 10 2016, 8:47 AM

LGTM.

Regarding the TODO - if you're planning on starting work on this anytime soon, I feel it'd be a good idea to send an RFC about this to llvm-dev.
Having the cost model specialized for different targets seems like a very large change, and we probably need wider discussion of what exactly this'll look like.

avt77 added a comment.Oct 11 2016, 4:07 AM

About TODO: of course we're going to prepare RFC for public discussions before real start of work.

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptJul 13 2019, 12:59 PM
pree-jackie added a subscriber: pree-jackie.