diff options
Diffstat (limited to 'llvm/tools/llvm-mca/InstrBuilder.cpp')
-rw-r--r-- | llvm/tools/llvm-mca/InstrBuilder.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/tools/llvm-mca/InstrBuilder.cpp b/llvm/tools/llvm-mca/InstrBuilder.cpp index c56a2792cd3..c45ec7d2866 100644 --- a/llvm/tools/llvm-mca/InstrBuilder.cpp +++ b/llvm/tools/llvm-mca/InstrBuilder.cpp @@ -139,8 +139,6 @@ static void populateWrites(InstrDesc &ID, const MCInst &MCI, const MCInstrDesc &MCDesc, const MCSchedClassDesc &SCDesc, const MCSubtargetInfo &STI) { - computeMaxLatency(ID, MCDesc, SCDesc, STI); - // Set if writes through this opcode may update super registers. // TODO: on x86-64, a 4 byte write of a general purpose register always // fully updates the super-register. @@ -410,6 +408,7 @@ void InstrBuilder::createInstrDescImpl(const MCInst &MCI) { ID->HasSideEffects = MCDesc.hasUnmodeledSideEffects(); initializeUsedResources(*ID, SCDesc, STI, ProcResourceMasks); + computeMaxLatency(*ID, MCDesc, SCDesc, STI); populateWrites(*ID, MCI, MCDesc, SCDesc, STI); populateReads(*ID, MCI, MCDesc, SCDesc, STI); @@ -431,7 +430,7 @@ InstrBuilder::createInstruction(unsigned Idx, const MCInst &MCI) { const InstrDesc &D = getOrCreateInstrDesc(MCI); std::unique_ptr<Instruction> NewIS = llvm::make_unique<Instruction>(D); - // Populate Reads first. + // Initialize Reads first. for (const ReadDescriptor &RD : D.Reads) { int RegID = -1; if (RD.OpIndex != -1) { @@ -455,7 +454,7 @@ InstrBuilder::createInstruction(unsigned Idx, const MCInst &MCI) { NewIS->getUses().emplace_back(llvm::make_unique<ReadState>(RD, RegID)); } - // Now populate writes. + // Initialize writes. for (const WriteDescriptor &WD : D.Writes) { unsigned RegID = WD.OpIndex == -1 ? WD.RegisterID : MCI.getOperand(WD.OpIndex).getReg(); |