From 373c38a2db3787b60a5d2588922e8b8eac389d17 Mon Sep 17 00:00:00 2001 From: Andrea Di Biagio Date: Thu, 8 Mar 2018 20:21:55 +0000 Subject: [llvm-mca] Fix handling of zero-latency instructions. This patch fixes a problem found when testing zero latency instructions on target AArch64 -mcpu=exynos-m3 / -mcpu=exynos-m1. On Exynos-m3/m1, direct branches are zero-latency instructions that don't consume any processor resources. The DispatchUnit marks zero-latency instructions as "executed", so that no scheduling is required. The event of instruction executed is then notified to all the listeners, and the reorder buffer (managed by the RetireControlUnit) is updated. In particular, the entry associated to the zero-latency instruction in the reorder buffer is marked as executed. Before this patch, the DispatchUnit forgot to assign a retire control unit token (RCUToken) to the zero-latency instruction. As a consequence, the RCUToken was used uninitialized. This was causing a crash in the RetireControlUnit logic. Fixes PR36650. llvm-svn: 327056 --- llvm/tools/llvm-mca/Backend.cpp | 5 ----- 1 file changed, 5 deletions(-) (limited to 'llvm/tools/llvm-mca/Backend.cpp') diff --git a/llvm/tools/llvm-mca/Backend.cpp b/llvm/tools/llvm-mca/Backend.cpp index 62e239524dd..fab725aecf7 100644 --- a/llvm/tools/llvm-mca/Backend.cpp +++ b/llvm/tools/llvm-mca/Backend.cpp @@ -43,11 +43,6 @@ void Backend::runCycle(unsigned Cycle) { Instructions[IR.first] = std::unique_ptr(NewIS); NewIS->setRCUTokenID(DU->dispatch(IR.first, NewIS)); - // If this is a zero latency instruction, then we don't need to dispatch - // it. Instead, we can mark it as executed. - if (NewIS->isZeroLatency()) - notifyInstructionExecuted(IR.first); - // Check if we have dispatched all the instructions. SM.updateNext(); if (!SM.hasNext()) -- cgit v1.2.3