summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-mca/Backend.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/tools/llvm-mca/Backend.cpp')
-rw-r--r--llvm/tools/llvm-mca/Backend.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/llvm/tools/llvm-mca/Backend.cpp b/llvm/tools/llvm-mca/Backend.cpp
index f000837be59..de345108fae 100644
--- a/llvm/tools/llvm-mca/Backend.cpp
+++ b/llvm/tools/llvm-mca/Backend.cpp
@@ -32,16 +32,15 @@ void Backend::runCycle(unsigned Cycle) {
notifyCycleBegin(Cycle);
while (SM.hasNext()) {
- InstRef IR = SM.peekNext();
- std::unique_ptr<Instruction> NewIS = IB.createInstruction(*IR.second);
+ SourceRef SR = SM.peekNext();
+ std::unique_ptr<Instruction> NewIS = IB.createInstruction(*SR.second);
const InstrDesc &Desc = NewIS->getDesc();
- if (!DU->isAvailable(Desc.NumMicroOps) ||
- !DU->canDispatch(IR.first, *NewIS))
- break;
-
Instruction *IS = NewIS.get();
- Instructions[IR.first] = std::move(NewIS);
- DU->dispatch(IR.first, IS, STI);
+ InstRef IR(SR.first, IS);
+ if (!DU->isAvailable(Desc.NumMicroOps) || !DU->canDispatch(IR))
+ break;
+ Instructions[SR.first] = std::move(NewIS);
+ DU->dispatch(IR, STI);
SM.updateNext();
}
OpenPOWER on IntegriCloud