OSDN Git Service

[llvm-mca] Fix an invalid memory read introduced by r346487.
authorAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>
Thu, 22 Nov 2018 12:48:57 +0000 (12:48 +0000)
committerAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>
Thu, 22 Nov 2018 12:48:57 +0000 (12:48 +0000)
commitab518ce813dd9c2de4467331a2cf00acdeb90df7
treecc60603c8c4e408b3a780b83b0749a31b4d9933f
parentb479b735253b3c6382ddb27254cb8faac210d552
[llvm-mca] Fix an invalid memory read introduced by r346487.

This patch fixes an invalid memory read introduced by r346487.
Before this patch, partial register write had to query the latency of the
dependent full register write by calling a method on the full write descriptor.
However, if the full write is from an already retired instruction, chances are
that the EntryStage already reclaimed its memory.
In some parial register write tests, valgrind was reporting an invalid
memory read.

This change fixes the invalid memory access problem. Writes are now responsible
for tracking dependent partial register writes, and notify them in the event of
instruction issued.
That means, partial register writes no longer need to query their associated
full write to check when they are ready to execute.

Added test X86/BtVer2/partial-reg-update-7.s

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@347459 91177308-0d34-0410-b5e6-96231b3b80d8
test/tools/llvm-mca/X86/BtVer2/partial-reg-update-7.s [new file with mode: 0644]
tools/llvm-mca/include/Instruction.h
tools/llvm-mca/lib/HardwareUnits/RegisterFile.cpp
tools/llvm-mca/lib/Instruction.cpp