1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00
llvm-mirror/lib/Transforms/Vectorize
Anna Thomas a0399f5bed [LV] Fix code gen for conditionally executed loads and stores
Fix a latent bug in loop vectorizer which generates incorrect code for
memory accesses that are executed conditionally. As pointed in review,
this bug definitely affects uniform loads and may affect conditional
stores that should have turned into scatters as well).

The code gen for conditionally executed uniform loads on architectures
that support masked gather instructions is broken.

Without this patch, we were unconditionally executing the *conditional*
load in the vectorized version.

This patch does the following:
1. Uniform conditional loads on architectures with gather support will
   have correct code generated. In particular, the cost model
   (setCostBasedWideningDecision) is fixed.
2. For the recipes which are handled after the widening decision is set,
   we use the isScalarWithPredication(I, VF) form which is added in the
   patch.

3. Fix the vectorization cost model for scalarization
   (getMemInstScalarizationCost): implement and use isPredicatedInst to
   identify *all* predicated instructions, not just scalar+predicated. So,
   now the cost for scalarization will be increased for maskedloads/stores
   and gather/scatter operations. In short, we should be choosing the
   gather/scatter in place of scalarization on archs where it is
   profitable.
4. We needed to weaken the assert in useEmulatedMaskMemRefHack.

Reviewers: Ayal, hsaito, mkuper

Differential Revision: https://reviews.llvm.org/D51313

llvm-svn: 341673
2018-09-07 15:53:48 +00:00
..
CMakeLists.txt [VPlan] Add VPInstruction to VPRecipe transformation. 2018-06-18 18:28:49 +00:00
LLVMBuild.txt
LoadStoreVectorizer.cpp [LoadStoreVectorizer] Use const reference 2018-07-26 01:11:36 +00:00
LoopVectorizationLegality.cpp [LV] Vectorize loops where non-phi instructions used outside loop 2018-08-21 14:40:27 +00:00
LoopVectorizationPlanner.h [VPlan] Move recipe construction to VPRecipeBuilder. 2018-06-08 17:30:45 +00:00
LoopVectorize.cpp [LV] Fix code gen for conditionally executed loads and stores 2018-09-07 15:53:48 +00:00
SLPVectorizer.cpp SLPVectorizer: Fix assert with different sized address spaces 2018-08-31 14:34:53 +00:00
Vectorize.cpp [LLVM-C] [OCaml] Remove LLVMAddBBVectorizePass 2018-05-28 16:58:10 +00:00
VPlan.cpp [VPlan] Introduce VPlan-based dominator analysis. 2018-07-30 21:33:31 +00:00
VPlan.h [VPlan] Introduce VPLoopInfo analysis. 2018-07-31 01:57:29 +00:00
VPlanDominatorTree.h [VPlan] Introduce VPlan-based dominator analysis. 2018-07-30 21:33:31 +00:00
VPlanHCFGBuilder.cpp [VPlan] Introduce VPLoopInfo analysis. 2018-07-31 01:57:29 +00:00
VPlanHCFGBuilder.h [VPlan] Introduce VPlan-based dominator analysis. 2018-07-30 21:33:31 +00:00
VPlanHCFGTransforms.cpp [VPlan] Add VPInstruction to VPRecipe transformation. 2018-06-18 18:28:49 +00:00
VPlanHCFGTransforms.h [VPlan] Add VPInstruction to VPRecipe transformation. 2018-06-18 18:28:49 +00:00
VPlanLoopInfo.h [VPlan] Introduce VPLoopInfo analysis. 2018-07-31 01:57:29 +00:00
VPlanValue.h [VPlan] Reland r332654 and silence unused func warning 2018-05-21 18:14:23 +00:00
VPlanVerifier.cpp [VPlan][LV] Introduce condition bit in VPBlockBase 2018-07-09 15:57:09 +00:00
VPlanVerifier.h [VPlan] Reland r332654 and silence unused func warning 2018-05-21 18:14:23 +00:00
VPRecipeBuilder.h [VPlan] Move recipe construction to VPRecipeBuilder. 2018-06-08 17:30:45 +00:00