OSDN Git Service

[llvm-mca] Correctly update the resource strategy for processor resources with multip...
authorAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>
Mon, 12 Nov 2018 13:09:39 +0000 (13:09 +0000)
committerAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>
Mon, 12 Nov 2018 13:09:39 +0000 (13:09 +0000)
commit736b8af9cf2d9383385e1f9fedf6a76b5424fc92
treeeac74a9fc7e960dfded093d0cde4e5372ed9fbc9
parentd3733c222cbbdae58fc3d09bda1559035ffa8cb7
[llvm-mca] Correctly update the resource strategy for processor resources with multiple units.

When looking at the tests committed by Roman at r346587, I noticed that numbers
reported by the resource pressure for PdAGU01 were wrong.

In particular, according to the aut-generated CHECK lines in tests
memcpy-like-test.s and store-throughput.s, resource pressure for PdAGU01
was not uniformly distributed among the two AGEN pipes.

It turns out that the reason why pressure was not correctly distributed, was
because the "resource selection strategy" object associated with PdAGU01 was not
correctly updated on the event of AGEN pipe used.
As a result, llvm-mca was not simulating a round-robin pipeline allocation for
PdAGU01. Instead, PdAGU1 was always prioritized over PdAGU0.

This patch fixes the issue; now processor resource strategy objects for
resources declaring multiple units, are correctly notified in the event of
"resource used".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346650 91177308-0d34-0410-b5e6-96231b3b80d8
22 files changed:
test/tools/llvm-mca/X86/BdVer2/dependency-breaking-pcmpeq.s
test/tools/llvm-mca/X86/BdVer2/dependency-breaking-pcmpgt.s
test/tools/llvm-mca/X86/BdVer2/dependent-pmuld-paddd.s
test/tools/llvm-mca/X86/BdVer2/dot-product.s
test/tools/llvm-mca/X86/BdVer2/load-store-alias.s
test/tools/llvm-mca/X86/BdVer2/load-throughput.s
test/tools/llvm-mca/X86/BdVer2/memcpy-like-test.s
test/tools/llvm-mca/X86/BdVer2/one-idioms.s
test/tools/llvm-mca/X86/BdVer2/partial-reg-update-6.s
test/tools/llvm-mca/X86/BdVer2/pipes-fpu.s
test/tools/llvm-mca/X86/BdVer2/reg-move-elimination-1.s
test/tools/llvm-mca/X86/BdVer2/reg-move-elimination-2.s
test/tools/llvm-mca/X86/BdVer2/reg-move-elimination-3.s
test/tools/llvm-mca/X86/BdVer2/register-files-1.s
test/tools/llvm-mca/X86/BdVer2/register-files-2.s
test/tools/llvm-mca/X86/BdVer2/store-throughput.s
test/tools/llvm-mca/X86/BdVer2/vbroadcast-operand-latency.s
test/tools/llvm-mca/X86/BdVer2/xop-super-registers-1.s
test/tools/llvm-mca/X86/BdVer2/xop-super-registers-2.s
test/tools/llvm-mca/X86/BdVer2/zero-idioms-avx-256.s
test/tools/llvm-mca/X86/BdVer2/zero-idioms.s
tools/llvm-mca/lib/HardwareUnits/ResourceManager.cpp