llvm-project/llvm/test/Transforms/LoopStrengthReduce/X86
Matthias Braun 189900eb14 X86: Stop assigning register costs for longer encodings.
This stops reporting CostPerUse 1 for `R8`-`R15` and `XMM8`-`XMM31`.
This was previously done because instruction encoding require a REX
prefix when using them resulting in longer instruction encodings. I
found that this regresses the quality of the register allocation as the
costs impose an ordering on eviction candidates. I also feel that there
is a bit of an impedance mismatch as the actual costs occure when
encoding instructions using those registers, but the order of VReg
assignments is not primarily ordered by number of Defs+Uses.

I did extensive measurements with the llvm-test-suite wiht SPEC2006 +
SPEC2017 included, internal services showed similar patterns. Generally
there are a log of improvements but also a lot of regression. But on
average the allocation quality seems to improve at a small code size
regression.

Results for measuring static and dynamic instruction counts:

Dynamic Counts (scaled by execution frequency) / Optimization Remarks:
    Spills+FoldedSpills   -5.6%
    Reloads+FoldedReloads -4.2%
    Copies                -0.1%

Static / LLVM Statistics:
    regalloc.NumSpills    mean -1.6%, geomean -2.8%
    regalloc.NumReloads   mean -1.7%, geomean -3.1%
    size..text            mean +0.4%, geomean +0.4%

Static / LLVM Statistics:
    mean -2.2%, geomean -3.1%) regalloc.NumSpills
    mean -2.6%, geomean -3.9%) regalloc.NumReloads
    mean +0.6%, geomean +0.6%) size..text

Static / LLVM Statistics:
    regalloc.NumSpills   mean -3.0%
    regalloc.NumReloads  mean -3.3%
    size..text           mean +0.3%, geomean +0.3%

Differential Revision: https://reviews.llvm.org/D133902
2022-09-30 16:01:33 -07:00
..
2008-08-14-ShadowIV.ll
2009-11-10-LSRCrash.ll
2011-07-20-DoubleIV.ll
2011-11-29-postincphi.ll
2011-12-04-loserreg.ll
2012-01-13-phielim.ll X86: Stop assigning register costs for longer encodings. 2022-09-30 16:01:33 -07:00
bin_power.ll
canonical-2.ll
canonical.ll
eh-insertion-point-2.ll
eh-insertion-point.ll
expander-crashes.ll
expander-reused-value-insert-point.ll
incorrect-offset-scaling.ll
ivchain-X86.ll X86: Stop assigning register costs for longer encodings. 2022-09-30 16:01:33 -07:00
ivchain-stress-X86.ll
lit.local.cfg
lsr-cond-dbg.ll
lsr-expand-quadratic.ll
lsr-filtering-scaledreg.ll
lsr-insns-1.ll
lsr-insns-2.ll X86: Stop assigning register costs for longer encodings. 2022-09-30 16:01:33 -07:00
lsr-overflow.ll
macro-fuse-cmp.ll
nested-loop.ll
nested-ptr-addrec.ll
no_superflous_induction_vars.ll
pr17473.ll
pr28719.ll
pr40514.ll
pr46943.ll
pr47776-do-not-apply-info-from-guards-to-addrecs.ll
sibling-loops.ll