Skip to content

Commit ea78835

Browse files
aratajewgfxbot
authored andcommitted
According to "strict weak ordering" rules, isInstPrecede function needs to return false value if compared values are equal, to be used as a comparator in std functions
Change-Id: I0e91da3c0b20e4c24324eaa211e3d80f7ab26025
1 parent 6cdd47e commit ea78835

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

IGC/Compiler/CISACodeGen/CodeSinking.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -976,7 +976,7 @@ bool CodeSinking::hoistCongruentPhi(PHINode* phi)
976976
if (apply)
977977
{
978978
auto compareFunc = [](const InstPair& a, const InstPair& b) {
979-
return (a.first == b.first) ? false : isInstPrecede(a.first, b.first);
979+
return isInstPrecede(a.first, b.first);
980980
};
981981
std::sort(instMap.begin(), instMap.end(), compareFunc);
982982

IGC/Compiler/CISACodeGen/helper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ inline bool isInstPrecede(
284284
assert(inst->getParent() == pos->getParent());
285285
if (inst == pos)
286286
{
287-
return true;
287+
return false;
288288
}
289289

290290
auto II = inst->getParent()->begin();

0 commit comments

Comments
 (0)