[llvm-dev] Question about Hexagon VLIWResourceModel::reserveResources

陳韋任 via llvm-dev llvm-dev at lists.llvm.org
Fri Apr 21 08:22:47 PDT 2017


Hi All,

  I am reading Hexagon's VLIW scheduler source code, and have a
question about VLIWResourceModel::reserveResources.
>From what I understand, it checks if a SU can be put in current
Packet. Intuitively, if current Packet is full, isResourceAvailable
should return false immediately. However, I see the code below:

---

  // If packet is now full, reset the state so in the next cycle
  // we start fresh.
  if (Packet.size() >= SchedModel->getIssueWidth()) {
    ResourcesModel->clearResources();
    savePacket();
    Packet.clear();
    TotalPackets++;
    startNewCycle = true;
  }

---

  I don't see reserveResources check if the Packet is full already,
and it seems possible that we have Packet.size >=
SchedModel->getIssueWidth().
Is the Packet valid?

  Thanks.

Regards,
chenwj

-- 
Wei-Ren Chen (陳韋任)
Homepage: https://people.cs.nctu.edu.tw/~chenwj


More information about the llvm-dev mailing list