[llvm] 68afaa3 - [LV] Use std::make_optional to fix build failure after 082a0046.

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 11 09:57:26 PDT 2023


Author: Florian Hahn
Date: 2023-04-11T17:56:15+01:00
New Revision: 68afaa3f48854021cda1c7af725c1431da9308d9

URL: https://github.com/llvm/llvm-project/commit/68afaa3f48854021cda1c7af725c1431da9308d9
DIFF: https://github.com/llvm/llvm-project/commit/68afaa3f48854021cda1c7af725c1431da9308d9.diff

LOG: [LV] Use std::make_optional to fix build failure after 082a0046.

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

Added: 
    

Modified: 
    llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
index 0081478270fe9..8915dd26f9e31 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
@@ -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) {


        


More information about the llvm-commits mailing list