[PATCH] D51313: [LV] Fix code gen for conditionally executed uniform loads
Anna Thomas via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 29 11:50:16 PDT 2018
anna added a comment.
To state what's fixed in latest patch:
1. Uniform loads on architectures with gather support will NOT be scalarized. In particular, both the cost model ( and the actual code gen in setCostBasedWideningDecision) and the codeGen for replication and widening recipes do the respective operations for widening decision != CM_GatherScatter. 1.1 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.
2. 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. In archs, where we don't have support for gather/scatter, we may no longer vectorize because scalarized and predicated loads/stores have high cost.
3. Given above 2, needed to weaken the assert in `useEmulatedMaskMemRefHack`.
Repository:
rL LLVM
https://reviews.llvm.org/D51313
More information about the llvm-commits
mailing list