llvm-project/llvm/test/CodeGen/X86/AMX
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
..
amx-across-func.ll X86: Stop assigning register costs for longer encodings. 2022-09-30 16:01:33 -07:00
amx-bf16-intrinsics.ll
amx-combine-undef.ll
amx-combine.ll
amx-config.ll
amx-configO0toO0.ll
amx-configO2toO0-lower.ll
amx-configO2toO0-precfg.ll
amx-configO2toO0.ll
amx-error.ll
amx-fastconfig-phi.mir [X86][NFC] Refine load/store reg to StackSlot for extensibility 2022-09-07 14:35:42 +08:00
amx-fastconfig-phi2.mir [X86][NFC] Refine load/store reg to StackSlot for extensibility 2022-09-07 14:35:42 +08:00
amx-fastconfig-phi4.mir [X86][NFC] Refine load/store reg to StackSlot for extensibility 2022-09-07 14:35:42 +08:00
amx-fastconfig-spill.mir
amx-fastconfig.mir
amx-fastpreconfig.mir
amx-gemm.ll
amx-greedy-ra-spill-shape.ll X86: Stop assigning register costs for longer encodings. 2022-09-30 16:01:33 -07:00
amx-greedy-ra.ll
amx-int8-intrinsics.ll
amx-intrinsic-chain.ll X86: Stop assigning register costs for longer encodings. 2022-09-30 16:01:33 -07:00
amx-ldtilecfg-insert.ll X86: Stop assigning register costs for longer encodings. 2022-09-30 16:01:33 -07:00
amx-low-intrinsics-no-amx-bitcast.ll
amx-low-intrinsics.ll
amx-lower-tile-copy.ll X86: Stop assigning register costs for longer encodings. 2022-09-30 16:01:33 -07:00
amx-sched.ll
amx-spill-merge.ll X86: Stop assigning register costs for longer encodings. 2022-09-30 16:01:33 -07:00
amx-spill.ll X86: Stop assigning register costs for longer encodings. 2022-09-30 16:01:33 -07:00
amx-tile-basic.ll
amx-tile-intrinsics.ll
amx-type.ll
amx-zero-config.ll
lat-combine-amx-bitcast.ll
lat-transform-amx-bitcast.ll