summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
diff options
context:
space:
mode:
authorAnna Thomas <anna@azul.com>2018-09-07 15:53:48 +0000
committerAnna Thomas <anna@azul.com>2018-09-07 15:53:48 +0000
commit110df11a1af095482a04ae876eae78bcd0d26b01 (patch)
tree741dc5845ae807d403c3b2269f5759fcdc852cb5 /llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
parenta6749135df51712eafd161245b38d8e62b73a254 (diff)
downloadbcm5719-llvm-110df11a1af095482a04ae876eae78bcd0d26b01.tar.gz
bcm5719-llvm-110df11a1af095482a04ae876eae78bcd0d26b01.zip
[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
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud