[llvm-bugs] [Bug 50725] New: [MCA] ResourceManager::selectPipe assertion failure "No available units to select!"

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Jun 15 13:20:18 PDT 2021


https://bugs.llvm.org/show_bug.cgi?id=50725

            Bug ID: 50725
           Summary: [MCA] ResourceManager::selectPipe assertion failure
                    "No available units to select!"
           Product: tools
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: llvm-mca
          Assignee: unassignedbugs at nondot.org
          Reporter: minyihh at uci.edu
                CC: andrea.dibiagio at gmail.com, llvm-bugs at lists.llvm.org,
                    matthew.davis at sony.com

Created attachment 24957
  --> https://bugs.llvm.org/attachment.cgi?id=24957&action=edit
input file that reproduces the crash

When running with command:
```
llvm-mca -mtriple=x86_64-pc-linux-gnu -mcpu=skylake --iterations=1 <attachment
file>
```
(I wish I could reduce the input further, but the original input was like 200k
lines. Here is the same input file on gist:
https://gist.github.com/mshockwave/ffcd56c83e1897b23c1835ae2eec2b89)
It gives us the following assertion failure:
```
llvm/lib/MCA/HardwareUnits/ResourceManager.cpp:181: llvm::mca::ResourceRef
llvm::mca::ResourceManager::selectPipe(uint64_t): Assertion `RS.isReady() &&
"No available units to select!"' failed.
...
#10 0x00007fb14f60c549 llvm::mca::ResourceManager::selectPipe(unsigned long)
(.localalias) llvm-project/llvm/lib/MCA/HardwareUnits/ResourceManager.cpp:181:3
#11 0x00007fb14f60cd0d
llvm::mca::ResourceManager::issueInstruction(llvm::mca::InstrDesc const&,
llvm::SmallVectorImpl<std::pair<std::pair<unsigned long, unsigned long>,
llvm::mca::ResourceCycles> >&)
llvm-project/llvm/lib/MCA/HardwareUnits/ResourceManager.cpp:309:44
#12 0x00007fb14f61495b
llvm::mca::Scheduler::issueInstructionImpl(llvm::mca::InstRef&,
llvm::SmallVectorImpl<std::pair<std::pair<unsigned long, unsigned long>,
llvm::mca::ResourceCycles> >&)
llvm-project/llvm/lib/MCA/HardwareUnits/Scheduler.cpp:83:14
#13 0x00007fb14f614b4e
llvm::mca::Scheduler::issueInstruction(llvm::mca::InstRef&,
llvm::SmallVectorImpl<std::pair<std::pair<unsigned long, unsigned long>,
llvm::mca::ResourceCycles> >&, llvm::SmallVectorImpl<llvm::mca::InstRef>&,
llvm::SmallVectorImpl<llvm::mca::InstRef>&)
llvm-project/llvm/lib/MCA/HardwareUnits/Scheduler.cpp:117:3
#14 0x00007fb14f63321b
llvm::mca::ExecuteStage::issueInstruction(llvm::mca::InstRef&)
llvm-project/llvm/lib/MCA/Stages/ExecuteStage.cpp:59:39
#15 0x00007fb14f633549 llvm::mca::ExecuteStage::issueReadyInstructions()
llvm-project/llvm/lib/MCA/Stages/ExecuteStage.cpp:90:41
...
```

The root cause is the `fxrstor 64(%rsp)` instruction on line 257. FXRSTOR
instruction consume 7 resources: SKLPort0, Port6, Port05, Port06, Port15,
Port23, and Port0156.
The issue occurred when ResourceManager tried to acquire Port15. Before this
instruction was executed, Port1 has been acquired by some other instructions,
and Port5 would be acquired by Port05 group in FXRSTOR, so ResourceManager
failed to acquire Port15.

My ball-park guessing is that Port15 should be marked reserved (which it is not
right now), although I'm not really sure how resource reservation works in
scheduling / MCA.

I'll keep posted here

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210615/fd1b2d51/attachment.html>


More information about the llvm-bugs mailing list