[llvm] r333692 - [llvm-mca] Fixed a problem caused by an invalid use of a processor resource mask in the Scheduler.
Andrea Di Biagio via llvm-commits
llvm-commits at lists.llvm.org
Thu May 31 13:27:46 PDT 2018
Author: adibiagio
Date: Thu May 31 13:27:46 2018
New Revision: 333692
URL: http://llvm.org/viewvc/llvm-project?rev=333692&view=rev
Log:
[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.
Modified:
llvm/trunk/tools/llvm-mca/Scheduler.cpp
Modified: llvm/trunk/tools/llvm-mca/Scheduler.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-mca/Scheduler.cpp?rev=333692&r1=333691&r2=333692&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-mca/Scheduler.cpp (original)
+++ llvm/trunk/tools/llvm-mca/Scheduler.cpp Thu May 31 13:27:46 2018
@@ -164,18 +164,16 @@ bool ResourceManager::canBeIssued(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(
More information about the llvm-commits
mailing list