[LV] Use std::make_optional to fix build failure after 082a0046.
authorFlorian Hahn <flo@fhahn.com>
Tue, 11 Apr 2023 16:51:10 +0000 (17:51 +0100)
committerFlorian Hahn <flo@fhahn.com>
Tue, 11 Apr 2023 16:56:15 +0000 (17:56 +0100)
Some compilers require std::make_optional(std::move()) to force construction
of the std::optional return value. This should fix the build failure in
  https://lab.llvm.org/buildbot#builders/67/builds/10991

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

index 0081478..8915dd2 100644 (file)
@@ -9103,7 +9103,7 @@ std::optional<VPlanPtr> LoopVectorizationPlanner::tryToBuildVPlanWithVPRecipes(
   VPlanTransforms::mergeBlocksIntoPredecessors(*Plan);
 
   assert(VPlanVerifier::verifyPlanIsValid(*Plan) && "VPlan is invalid");
-  return Plan;
+  return std::make_optional(std::move(Plan));
 }
 
 VPlanPtr LoopVectorizationPlanner::buildVPlan(VFRange &Range) {