This is an archive of the discontinued LLVM Phabricator instance.

Add Instruction number to LSR cost model (PR23384) part 3 of 3
ClosedPublic

Authored by evstupac on Mar 2 2017, 7:59 PM.

Details

Summary

The patch depends on D30561 (compilation will fail without it).
It makes Insns number priority number in LSR cost for X86
and
Adds Cross Uses to make possible solution without cmp (less on 1 instruction) - this is required by some tests to be consistent (choose solution without cmp for all cases).

Diff Detail

Repository
rL LLVM

Event Timeline

evstupac created this revision.Mar 2 2017, 7:59 PM
qcolombet requested changes to this revision.Mar 14 2017, 10:59 AM

Hi,

I see two different things in that patch:

  1. X86 cost model change
  2. GenerateCrossUseICmpZero

Please make two separate patches.

For both cases, I expect a thorough benchmarking numbers for Os and O3.

Cheers,
-Quentin

This revision now requires changes to proceed.Mar 14 2017, 10:59 AM

Hi Quentin,

I see two different things in that patch:

  1. X86 cost model change
  2. GenerateCrossUseICmpZero

Please make two separate patches.

ok. I thought that since 2. does not make any difference without -lsr-insns-cost it would be fair to commit it with 1.

For both cases, I expect a thorough benchmarking numbers for Os and O3.

  1. itself do not make any significant difference. For most benchmarks I've got build same.

For 1. I received only one feedback to llvm-dev:
400.perlbench 1.001288
401.bzip2 0.996352
445.gobmk 0.998473
456.hmmer 1.009015
458.sjeng 1.011942
462.libquantum 1.003234
464.h264ref 0.995798
471.omnetpp 1.004245
473.astar 1.002221
483.xalancbmk 0.993139
403.gcc 1.001213
429.mcf 1.004345
Geomean 1.00176

My own measurements a generally better for x86 (however I ran only -O2 and -Ofast).

Thanks,
Evgeny

evstupac updated this revision to Diff 98550.May 10 2017, 4:11 PM
evstupac edited edge metadata.

Exclude "Cross Uses to make possible solution without cmp".
Update tests accordingly.
Rebase on newest trunk.

Note, the patch will work only after D30561 commit (which make sense only if the patch is approved).

Code size numbers for x86 spec2000 O2, 32 bit:
Overall code size (sum of all spec text section binary sizes) -0.2%, overall instruction count -0.3%

177.mesa -1.31%
179.art -0.09%
183.equake -0.06%
188.ammp -0.20%
164.gzip -0.15%
175.vpr -0.05%
176.gcc 0.02%
181.mcf 0.30%
186.crafty 0.09%
197.parser 0.07%
252.eon -0.05%
253.perlbmk -0.05%
254.gap -0.12%
255.vortex -0.01%
256.bzip2 0.19%
300.twolf -0.04%

qcolombet accepted this revision.Jun 5 2017, 11:05 AM

Hi Evgeny,

Thanks for your patience. (Honestly the pings slipped through the crack.)

LGTM.

Cheers,
-Quentin

This revision is now accepted and ready to land.Jun 5 2017, 11:05 AM
This revision was automatically updated to reflect the committed changes.