diff options
author | Diego Novillo <dnovillo@google.com> | 2014-04-29 20:06:10 +0000 |
---|---|---|
committer | Diego Novillo <dnovillo@google.com> | 2014-04-29 20:06:10 +0000 |
commit | cd64780d186c60ecd588699bf8adfb82f638bf86 (patch) | |
tree | 1229263ce04da142d4b70f637844a9a246331037 /llvm/lib/Transforms/Vectorize | |
parent | df51ee6c50f48749b738a324951dc2ed0d83333d (diff) | |
download | bcm5719-llvm-cd64780d186c60ecd588699bf8adfb82f638bf86.tar.gz bcm5719-llvm-cd64780d186c60ecd588699bf8adfb82f638bf86.zip |
Fix vectorization remarks.
This patch changes the vectorization remarks to also inform when
vectorization is possible but not beneficial.
Added tests to exercise some loop remarks.
llvm-svn: 207574
Diffstat (limited to 'llvm/lib/Transforms/Vectorize')
-rw-r--r-- | llvm/lib/Transforms/Vectorize/LoopVectorize.cpp | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp index 586c220162f..af0e686a521 100644 --- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp +++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp @@ -1209,6 +1209,13 @@ struct LoopVectorize : public FunctionPass { if (UF == 1) return false; DEBUG(dbgs() << "LV: Trying to at least unroll the loops.\n"); + + // Report the unrolling decision. + F->getContext().emitOptimizationRemark( + DEBUG_TYPE, *F, L->getStartLoc(), + Twine("unrolled with interleaving factor " + Twine(UF) + + " (vectorization not beneficial)")); + // We decided not to vectorize, but we may want to unroll. InnerLoopUnroller Unroller(L, SE, LI, DT, DL, TLI, UF); Unroller.vectorize(&LVL); @@ -1217,17 +1224,17 @@ struct LoopVectorize : public FunctionPass { InnerLoopVectorizer LB(L, SE, LI, DT, DL, TLI, VF.Width, UF); LB.vectorize(&LVL); ++LoopsVectorized; + + // Report the vectorization decision. + F->getContext().emitOptimizationRemark( + DEBUG_TYPE, *F, L->getStartLoc(), + Twine("vectorized loop (vectorization factor: ") + Twine(VF.Width) + + ", unrolling interleave factor: " + Twine(UF) + ")"); } // Mark the loop as already vectorized to avoid vectorizing again. Hints.setAlreadyVectorized(L); - // Report the vectorization decision. - F->getContext().emitOptimizationRemark( - DEBUG_TYPE, *F, L->getStartLoc(), - Twine("vectorized loop (vectorization factor: ") + Twine(VF.Width) + - ", unroll factor: " + Twine(UF) + ")"); - DEBUG(verifyFunction(*L->getHeader()->getParent())); return true; } |