1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00

[llvm-mca] Clear the content of map VariantDescriptors in InstrBuilder before we start analyzing a new CodeBlock. NFCI.

Different CodeBlocks don't overlap. The same MCInst cannot appear in more than
one code block because all blocks are instantiated before the simulation is run.

We should always clear the content of map VariantDescriptors before every
simulation, since VariantDescriptors cannot possibly store useful information
for the next blocks. It is also "safer" to clear its content because `MCInst*`
is used as the key type for map VariantDescriptors.

llvm-svn: 336142
This commit is contained in:
Andrea Di Biagio 2018-07-02 20:39:57 +00:00
parent 379ae77a60
commit 9758b05b3b
2 changed files with 5 additions and 0 deletions

View File

@ -69,6 +69,8 @@ public:
return ProcResourceMasks;
}
void clear() { VariantDescriptors.shrink_and_clear(); }
std::unique_ptr<Instruction> createInstruction(const llvm::MCInst &MCI);
};
} // namespace mca

View File

@ -547,6 +547,9 @@ int main(int argc, char **argv) {
P->run();
Printer.printReport(TOF->os());
// Clear the InstrBuilder internal state in preparation for another round.
IB.clear();
}
TOF->keep();