[llvm] d1bd5e4 - SLPVectorizer - make comparison operators + isInSchedulingRegion const
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 13 06:42:07 PST 2019
Author: Simon Pilgrim
Date: 2019-11-13T14:40:19Z
New Revision: d1bd5e476b6baeaaa7b5ad3debf4e4ff9bae295e
URL: https://github.com/llvm/llvm-project/commit/d1bd5e476b6baeaaa7b5ad3debf4e4ff9bae295e
DIFF: https://github.com/llvm/llvm-project/commit/d1bd5e476b6baeaaa7b5ad3debf4e4ff9bae295e.diff
LOG: SLPVectorizer - make comparison operators + isInSchedulingRegion const
Fixes cppcheck warnings.
Added:
Modified:
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
index 33b168f001c5..ad97616b85bf 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -1940,7 +1940,7 @@ class BoUpSLP {
return nullptr;
}
- bool isInSchedulingRegion(ScheduleData *SD) {
+ bool isInSchedulingRegion(ScheduleData *SD) const {
return SD->SchedulingRegionID == SchedulingRegionID;
}
@@ -6221,12 +6221,12 @@ class HorizontalReduction {
/// Checks if two operation data are both a reduction op or both a reduced
/// value.
- bool operator==(const OperationData &OD) {
+ bool operator==(const OperationData &OD) const {
assert(((Kind != OD.Kind) || ((!LHS == !OD.LHS) && (!RHS == !OD.RHS))) &&
"One of the comparing operations is incorrect.");
return this == &OD || (Kind == OD.Kind && Opcode == OD.Opcode);
}
- bool operator!=(const OperationData &OD) { return !(*this == OD); }
+ bool operator!=(const OperationData &OD) const { return !(*this == OD); }
void clear() {
Opcode = 0;
LHS = nullptr;
More information about the llvm-commits
mailing list