mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-21 03:53:04 +02:00
a0399f5bed
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 |
||
---|---|---|
.. | ||
CMakeLists.txt | ||
LLVMBuild.txt | ||
LoadStoreVectorizer.cpp | ||
LoopVectorizationLegality.cpp | ||
LoopVectorizationPlanner.h | ||
LoopVectorize.cpp | ||
SLPVectorizer.cpp | ||
Vectorize.cpp | ||
VPlan.cpp | ||
VPlan.h | ||
VPlanDominatorTree.h | ||
VPlanHCFGBuilder.cpp | ||
VPlanHCFGBuilder.h | ||
VPlanHCFGTransforms.cpp | ||
VPlanHCFGTransforms.h | ||
VPlanLoopInfo.h | ||
VPlanValue.h | ||
VPlanVerifier.cpp | ||
VPlanVerifier.h | ||
VPRecipeBuilder.h |