[PATCH] D138635: [MLGO] Fix InlineAdvisor and ModelUnderTrainingRunner after hasValue removal
Aiden Grossman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 23 19:44:21 PST 2022
aidengrossman created this revision.
Herald added subscribers: mtrofin, hiraditya.
Herald added a project: All.
aidengrossman requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
Recentlyin 4b6b248 <https://reviews.llvm.org/rG4b6b248731b81deb471838ff79392993aeb6c621>, llvm::Optional's hasValue method was removed as
described in
https://discourse.llvm.org/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor
This breaks InlineAdvisor and ModelUnderTrainingRunner. This patch fixes
them by changing the method to has_value, which hasValue was evaluating
to before.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D138635
Files:
llvm/lib/Analysis/InlineAdvisor.cpp
llvm/lib/Analysis/ModelUnderTrainingRunner.cpp
Index: llvm/lib/Analysis/ModelUnderTrainingRunner.cpp
===================================================================
--- llvm/lib/Analysis/ModelUnderTrainingRunner.cpp
+++ llvm/lib/Analysis/ModelUnderTrainingRunner.cpp
@@ -40,7 +40,7 @@
void *ModelUnderTrainingRunner::evaluateUntyped() {
LastEvaluationResult = Evaluator->evaluate();
- if (!LastEvaluationResult.hasValue()) {
+ if (!LastEvaluationResult.has_value()) {
Ctx.emitError("Error evaluating model.");
return nullptr;
}
Index: llvm/lib/Analysis/InlineAdvisor.cpp
===================================================================
--- llvm/lib/Analysis/InlineAdvisor.cpp
+++ llvm/lib/Analysis/InlineAdvisor.cpp
@@ -217,7 +217,7 @@
Advisor =
llvm::getDevelopmentModeAdvisor(M, MAM, [&FAM, Params](CallBase &CB) {
auto OIC = getDefaultInlineAdvice(CB, FAM, Params);
- return OIC.hasValue();
+ return OIC.has_value();
});
#endif
break;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D138635.477677.patch
Type: text/x-patch
Size: 977 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221124/25211858/attachment.bin>
More information about the llvm-commits
mailing list