diff options
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp index 66a779d..7042af6 100644 --- a/llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp +++ b/llvm/lib/Transforms/Vectorize/LoopVectorizationLegality.cpp @@ -1451,10 +1451,12 @@ bool LoopVectorizationLegality::canVectorize(bool UseVPlanNativePath) { // Check whether the loop-related control flow in the loop nest is expected by // vectorizer. if (!canVectorizeLoopNestCFG(TheLoop, UseVPlanNativePath)) { - if (DoExtraAnalysis) + if (DoExtraAnalysis) { + LLVM_DEBUG(dbgs() << "LV: legality check failed: loop nest"); Result = false; - else + } else { return false; + } } // We need to have a loop header. @@ -1519,17 +1521,21 @@ bool LoopVectorizationLegality::canVectorize(bool UseVPlanNativePath) { return false; } - LLVM_DEBUG(dbgs() << "LV: We can vectorize this loop" - << (LAI->getRuntimePointerChecking()->Need - ? " (with a runtime bound check)" - : "") - << "!\n"); + if (Result) { + LLVM_DEBUG(dbgs() << "LV: We can vectorize this loop" + << (LAI->getRuntimePointerChecking()->Need + ? " (with a runtime bound check)" + : "") + << "!\n"); + } unsigned SCEVThreshold = VectorizeSCEVCheckThreshold; if (Hints->getForce() == LoopVectorizeHints::FK_Enabled) SCEVThreshold = PragmaVectorizeSCEVCheckThreshold; if (PSE.getPredicate().getComplexity() > SCEVThreshold) { + LLVM_DEBUG(dbgs() << "LV: Vectorization not profitable " + "due to SCEVThreshold"); reportVectorizationFailure("Too many SCEV checks needed", "Too many SCEV assumptions need to be made and checked at runtime", "TooManySCEVRunTimeChecks", ORE, TheLoop); |