diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2019-10-09 20:54:06 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2019-10-09 20:54:06 +0000 |
commit | adc38dcf5ff066ca5c445af023c6e75e32757bd9 (patch) | |
tree | 5dc3b11b4f2d3b3f7c3a426456d63601782b97d8 /clang/lib/CodeGen/CGOpenMPRuntime.cpp | |
parent | ff5a7c4ca6eadb5fd776a01b0e16800effcc8cfc (diff) | |
download | bcm5719-llvm-adc38dcf5ff066ca5c445af023c6e75e32757bd9.tar.gz bcm5719-llvm-adc38dcf5ff066ca5c445af023c6e75e32757bd9.zip |
[OPENMP50]Fix scoring of contexts with and without user provided scores.
The context selector with user provided score must have higher score
than the context selector without user provided score.
llvm-svn: 374224
Diffstat (limited to 'clang/lib/CodeGen/CGOpenMPRuntime.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGOpenMPRuntime.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGOpenMPRuntime.cpp b/clang/lib/CodeGen/CGOpenMPRuntime.cpp index d2f18a5767b..2ad6d01fda5 100644 --- a/clang/lib/CodeGen/CGOpenMPRuntime.cpp +++ b/clang/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) |