diff options
author | Andrea Di Biagio <Andrea_DiBiagio@sn.scee.net> | 2018-03-15 16:13:12 +0000 |
---|---|---|
committer | Andrea Di Biagio <Andrea_DiBiagio@sn.scee.net> | 2018-03-15 16:13:12 +0000 |
commit | af904b99195a8fa5d90c1558c1b85768bf567bcf (patch) | |
tree | e42f46f29293c3f63273c142fbea8faa17ade2bb /llvm/tools/llvm-mca | |
parent | 876c1ed2e5ece477113bf3a7959acc5a1aa498ad (diff) | |
download | bcm5719-llvm-af904b99195a8fa5d90c1558c1b85768bf567bcf.tar.gz bcm5719-llvm-af904b99195a8fa5d90c1558c1b85768bf567bcf.zip |
[llvm-mca] Simplify code. NFC.
Now both method DispatchUnit::checkRAT() and DispatchUnit::canDispatch take as
input an Instruction refrence instead of an instruction descriptor.
This was requested by Simon in D44488 to simplify the diff.
llvm-svn: 327640
Diffstat (limited to 'llvm/tools/llvm-mca')
-rw-r--r-- | llvm/tools/llvm-mca/Backend.cpp | 2 | ||||
-rw-r--r-- | llvm/tools/llvm-mca/Dispatch.cpp | 3 | ||||
-rw-r--r-- | llvm/tools/llvm-mca/Dispatch.h | 7 |
3 files changed, 7 insertions, 5 deletions
diff --git a/llvm/tools/llvm-mca/Backend.cpp b/llvm/tools/llvm-mca/Backend.cpp index 96668294498..46c7a735e9e 100644 --- a/llvm/tools/llvm-mca/Backend.cpp +++ b/llvm/tools/llvm-mca/Backend.cpp @@ -36,7 +36,7 @@ void Backend::runCycle(unsigned Cycle) { std::unique_ptr<Instruction> NewIS( IB->createInstruction(STI, IR.first, *IR.second)); const InstrDesc &Desc = NewIS->getDesc(); - if (!DU->isAvailable(Desc.NumMicroOps) || !DU->canDispatch(Desc)) + if (!DU->isAvailable(Desc.NumMicroOps) || !DU->canDispatch(*NewIS)) break; Instruction *IS = NewIS.get(); diff --git a/llvm/tools/llvm-mca/Dispatch.cpp b/llvm/tools/llvm-mca/Dispatch.cpp index 33b5f4926c9..50b118b310c 100644 --- a/llvm/tools/llvm-mca/Dispatch.cpp +++ b/llvm/tools/llvm-mca/Dispatch.cpp @@ -199,7 +199,8 @@ void RetireControlUnit::dump() const { } #endif -bool DispatchUnit::checkRAT(const InstrDesc &Desc) { +bool DispatchUnit::checkRAT(const Instruction &Instr) { + const InstrDesc &Desc = Instr.getDesc(); unsigned NumWrites = Desc.Writes.size(); if (RAT->isAvailable(NumWrites)) return true; diff --git a/llvm/tools/llvm-mca/Dispatch.h b/llvm/tools/llvm-mca/Dispatch.h index 66ac2f7e64a..b342976db27 100644 --- a/llvm/tools/llvm-mca/Dispatch.h +++ b/llvm/tools/llvm-mca/Dispatch.h @@ -233,7 +233,7 @@ class DispatchUnit { // stored into a vector `DispatchStall` which is always of size DS_LAST. std::vector<unsigned> DispatchStalls; - bool checkRAT(const InstrDesc &Desc); + bool checkRAT(const Instruction &Desc); bool checkRCU(const InstrDesc &Desc); bool checkScheduler(const InstrDesc &Desc); @@ -260,9 +260,10 @@ public: bool isRCUEmpty() const { return RCU->isEmpty(); } - bool canDispatch(const InstrDesc &Desc) { + bool canDispatch(const Instruction &Inst) { + const InstrDesc &Desc = Inst.getDesc(); assert(isAvailable(Desc.NumMicroOps)); - return checkRCU(Desc) && checkRAT(Desc) && checkScheduler(Desc); + return checkRCU(Desc) && checkRAT(Inst) && checkScheduler(Desc); } unsigned dispatch(unsigned IID, Instruction *NewInst, |