diff options
author | Florian Hahn <flo@fhahn.com> | 2019-04-10 08:17:28 +0000 |
---|---|---|
committer | Florian Hahn <flo@fhahn.com> | 2019-04-10 08:17:28 +0000 |
commit | db1a69c2504fb53a33398211f83b2e2b663b7c3e (patch) | |
tree | 7e2b0a5ad01fdc8b089646d662eaef62a9693f3d /llvm/lib | |
parent | f5f45f21d84b6e447f3736239c18ea826ccf7f39 (diff) | |
download | bcm5719-llvm-db1a69c2504fb53a33398211f83b2e2b663b7c3e.tar.gz bcm5719-llvm-db1a69c2504fb53a33398211f83b2e2b663b7c3e.zip |
[VPLAN] Minor improvement to testing and debug messages.
1. Use computed VF for stress testing.
2. If the computed VF does not produce vector code (VF smaller than 2), force VF to be 4.
3. Test vectorization of i64 data on AArch64 to make sure we generate VF != 4 (on X86 that was already tested on AVX).
Patch by Francesco Petrogalli <francesco.petrogalli@arm.com>
Differential Revision: https://reviews.llvm.org/D59952
llvm-svn: 358056
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Transforms/Vectorize/LoopVectorize.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp index 7f16d96e71c..5612e956794 100644 --- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp +++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp @@ -6117,17 +6117,20 @@ LoopVectorizationPlanner::planInVPlanNativePath(bool OptForSize, // If the user doesn't provide a vectorization factor, determine a // reasonable one. if (!UserVF) { - // We set VF to 4 for stress testing. - if (VPlanBuildStressTest) + VF = determineVPlanVF(TTI->getRegisterBitWidth(true /* Vector*/), CM); + LLVM_DEBUG(dbgs() << "LV: VPlan computed VF " << VF << ".\n"); + + // Make sure we have a VF > 1 for stress testing. + if (VPlanBuildStressTest && VF < 2) { + LLVM_DEBUG(dbgs() << "LV: VPlan stress testing: " + << "overriding computed VF.\n"); VF = 4; - else - VF = determineVPlanVF(TTI->getRegisterBitWidth(true /* Vector*/), CM); + } } - assert(EnableVPlanNativePath && "VPlan-native path is not enabled."); assert(isPowerOf2_32(VF) && "VF needs to be a power of two"); - LLVM_DEBUG(dbgs() << "LV: Using " << (UserVF ? "user VF " : "computed VF ") - << VF << " to build VPlans.\n"); + LLVM_DEBUG(dbgs() << "LV: Using " << (UserVF ? "user " : "") << "VF " << VF + << " to build VPlans.\n"); buildVPlans(VF, VF); // For VPlan build stress testing, we bail out after VPlan construction. |