Skip to content

Commit d1bd5e4

Browse files
committed
SLPVectorizer - make comparison operators + isInSchedulingRegion const
Fixes cppcheck warnings.
1 parent 16bdcc8 commit d1bd5e4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1940,7 +1940,7 @@ class BoUpSLP {
19401940
return nullptr;
19411941
}
19421942

1943-
bool isInSchedulingRegion(ScheduleData *SD) {
1943+
bool isInSchedulingRegion(ScheduleData *SD) const {
19441944
return SD->SchedulingRegionID == SchedulingRegionID;
19451945
}
19461946

@@ -6221,12 +6221,12 @@ class HorizontalReduction {
62216221

62226222
/// Checks if two operation data are both a reduction op or both a reduced
62236223
/// value.
6224-
bool operator==(const OperationData &OD) {
6224+
bool operator==(const OperationData &OD) const {
62256225
assert(((Kind != OD.Kind) || ((!LHS == !OD.LHS) && (!RHS == !OD.RHS))) &&
62266226
"One of the comparing operations is incorrect.");
62276227
return this == &OD || (Kind == OD.Kind && Opcode == OD.Opcode);
62286228
}
6229-
bool operator!=(const OperationData &OD) { return !(*this == OD); }
6229+
bool operator!=(const OperationData &OD) const { return !(*this == OD); }
62306230
void clear() {
62316231
Opcode = 0;
62326232
LHS = nullptr;

0 commit comments

Comments
 (0)