[llvm] f3cfec9 - [MCA] Fix a warning
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 20 09:46:49 PDT 2021
Author: Kazu Hirata
Date: 2021-09-20T09:46:38-07:00
New Revision: f3cfec9c9e6d90505baaef8ff25ed709e347b226
URL: https://github.com/llvm/llvm-project/commit/f3cfec9c9e6d90505baaef8ff25ed709e347b226
DIFF: https://github.com/llvm/llvm-project/commit/f3cfec9c9e6d90505baaef8ff25ed709e347b226.diff
LOG: [MCA] Fix a warning
This patch fixes the warning
InstructionTables.cpp:27:56: error: loop variable 'Resource' of type
'const std::pair<const uint64_t, ResourceUsage> &' (aka 'const
pair<const unsigned long, llvm::mca::ResourceUsage> &') binds to a
temporary constructed from type 'const std::pair<unsigned long,
llvm::mca::ResourceUsage> &' [-Werror,-Wrange-loop-construct]
Note that Resource is declared as:
SmallVector<std::pair<uint64_t, ResourceUsage>, 4> Resources;
without "const" for uint64_t.
Added:
Modified:
llvm/lib/MCA/Stages/InstructionTables.cpp
Removed:
################################################################################
diff --git a/llvm/lib/MCA/Stages/InstructionTables.cpp b/llvm/lib/MCA/Stages/InstructionTables.cpp
index fcd7e91ed997..a842b52dcd39 100644
--- a/llvm/lib/MCA/Stages/InstructionTables.cpp
+++ b/llvm/lib/MCA/Stages/InstructionTables.cpp
@@ -24,7 +24,7 @@ Error InstructionTables::execute(InstRef &IR) {
UsedResources.clear();
// Identify the resources consumed by this instruction.
- for (const std::pair<const uint64_t, ResourceUsage> &Resource :
+ for (const std::pair<uint64_t, ResourceUsage> &Resource :
Desc.Resources) {
// Skip zero-cycle resources (i.e., unused resources).
if (!Resource.second.size())
More information about the llvm-commits
mailing list