[llvm-mca] Move the logic that updates the register files from InstrBuilder to Dispat...
authorAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>
Wed, 14 Mar 2018 14:57:23 +0000 (14:57 +0000)
committerAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>
Wed, 14 Mar 2018 14:57:23 +0000 (14:57 +0000)
commit4732d43cae0c9d8a7b9c6f8bf40c86e0f5650e17
tree4d1f6bc55b2e1ce4c0d0801671dfa2f489219d64
parentd3dcf2f05d0b15a51ed3ca0021943b935c708142
[llvm-mca] Move the logic that updates the register files from InstrBuilder to DispatchUnit. NFCI

Before this patch, the register file was always updated at instruction creation
time. That means, new read-after-write dependencies, and new temporary registers
were allocated at instruction creation time.

This patch refactors the code in InstrBuilder, and move all the logic that
updates the register file into the dispatch unit. We only want to update the
register file when instructions are effectively dispatched (not before).

This refactoring also helps removing a bad dependency between the InstrBuilder
and the DispatchUnit.

No functional change intended.

llvm-svn: 327514
llvm/tools/llvm-mca/Backend.cpp
llvm/tools/llvm-mca/Dispatch.cpp
llvm/tools/llvm-mca/Dispatch.h
llvm/tools/llvm-mca/InstrBuilder.cpp
llvm/tools/llvm-mca/InstrBuilder.h
llvm/tools/llvm-mca/Instruction.h