#include <memory>
namespace llvm {
+
namespace mca {
constexpr int UNKNOWN_CYCLES = -512;
InstrDesc() = default;
InstrDesc(const InstrDesc &Other) = delete;
InstrDesc &operator=(const InstrDesc &Other) = delete;
+
+#ifndef NDEBUG
+ // Original instruction name for debugging purposes.
+ StringRef Name;
+#endif
};
/// Base class for instructions consumed by the simulation pipeline.
// Second, is the specific sub-resource ID.
ResourceRef ResourceManager::selectPipe(uint64_t ResourceID) {
unsigned Index = getResourceStateIndex(ResourceID);
+ assert(Index < Resources.size() && "Invalid resource use!");
ResourceState &RS = *Resources[Index];
assert(RS.isReady() && "No available units to select!");
populateWrites(*ID, MCI, SchedClassID);
populateReads(*ID, MCI, SchedClassID);
+#ifndef NDEBUG
+ ID->Name = MCII.getName(Opcode);
+#endif
LLVM_DEBUG(dbgs() << "\t\tMaxLatency=" << ID->MaxLatency << '\n');
LLVM_DEBUG(dbgs() << "\t\tNumMicroOps=" << ID->NumMicroOps << '\n');