forked from OSchip/llvm-project
[llvm-mca] Fixed a problem caused by an invalid use of a processor resource mask in the Scheduler.
The lambda functions used by method ResourceManager::mustIssueImmediately() was incorrectly truncating masks of buffered processor resources to 32-bit quantities. The invalid mask values were then used to access a map of processor resource descriptors. Fixes PR37643. llvm-svn: 333692
This commit is contained in:
parent
739174c4be
commit
4037011404
|
@ -164,18 +164,16 @@ bool ResourceManager::canBeIssued(const InstrDesc &Desc) const {
|
|||
bool ResourceManager::mustIssueImmediately(const InstrDesc &Desc) {
|
||||
if (!canBeIssued(Desc))
|
||||
return false;
|
||||
bool AllInOrderResources = std::all_of(
|
||||
Desc.Buffers.begin(), Desc.Buffers.end(), [&](const unsigned BufferMask) {
|
||||
const ResourceState &Resource = *Resources[BufferMask];
|
||||
return Resource.isInOrder() || Resource.isADispatchHazard();
|
||||
});
|
||||
bool AllInOrderResources = all_of(Desc.Buffers, [&](uint64_t BufferMask) {
|
||||
const ResourceState &Resource = *Resources[BufferMask];
|
||||
return Resource.isInOrder() || Resource.isADispatchHazard();
|
||||
});
|
||||
if (!AllInOrderResources)
|
||||
return false;
|
||||
|
||||
return std::any_of(Desc.Buffers.begin(), Desc.Buffers.end(),
|
||||
[&](const unsigned BufferMask) {
|
||||
return Resources[BufferMask]->isADispatchHazard();
|
||||
});
|
||||
return any_of(Desc.Buffers, [&](uint64_t BufferMask) {
|
||||
return Resources[BufferMask]->isADispatchHazard();
|
||||
});
|
||||
}
|
||||
|
||||
void ResourceManager::issueInstruction(
|
||||
|
|
Loading…
Reference in New Issue