summaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGOpenMPRuntime.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen/CGOpenMPRuntime.cpp')
-rw-r--r--lib/CodeGen/CGOpenMPRuntime.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/CodeGen/CGOpenMPRuntime.cpp b/lib/CodeGen/CGOpenMPRuntime.cpp
index d2f18a5767..2ad6d01fda 100644
--- a/lib/CodeGen/CGOpenMPRuntime.cpp
+++ b/lib/CodeGen/CGOpenMPRuntime.cpp
@@ -11187,7 +11187,7 @@ static bool greaterCtxScore(ASTContext &Ctx, const Expr *LHS, const Expr *RHS) {
return false;
llvm::APSInt LHSVal = LHS->EvaluateKnownConstInt(Ctx);
llvm::APSInt RHSVal = RHS->EvaluateKnownConstInt(Ctx);
- return llvm::APSInt::compareValues(LHSVal, RHSVal) <= 0;
+ return llvm::APSInt::compareValues(LHSVal, RHSVal) >= 0;
}
namespace {
@@ -11250,7 +11250,7 @@ static const FunctionDecl *getDeclareVariantFunction(ASTContext &Ctx,
}
// If the attribute matches the context, find the attribute with the highest
// score.
- if (SelectedAttr && (!TopMostAttr || Comparer(TopMostAttr, SelectedAttr)))
+ if (SelectedAttr && (!TopMostAttr || !Comparer(TopMostAttr, SelectedAttr)))
TopMostAttr = SelectedAttr;
}
if (!TopMostAttr)