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
Dorit Nuzman 157ae50057 [LV] Support efficient vectorization of an induction with redundant casts
D30041 extended SCEVPredicateRewriter to improve handling of Phi nodes whose
update chain involves casts; PSCEV can now build an AddRecurrence for some
forms of such phi nodes, under the proper runtime overflow test. This means
that we can identify such phi nodes as an induction, and the loop-vectorizer
can now vectorize such inductions, however inefficiently. The vectorizer
doesn't know that it can ignore the casts, and so it vectorizes them.

This patch records the casts in the InductionDescriptor, so that they could
be marked to be ignored for cost calculation (we use VecValuesToIgnore for
that) and ignored for vectorization/widening/scalarization (i.e. treated as
TriviallyDead).

In addition to marking all these casts to be ignored, we also need to make
sure that each cast is mapped to the right vector value in the vector loop body
(be it a widened, vectorized, or scalarized induction). So whenever an
induction phi is mapped to a vector value (during vectorization/widening/
scalarization), we also map the respective cast instruction (if exists) to that
vector value. (If the phi-update sequence of an induction involves more than one
cast, then the above mapping to vector value is relevant only for the last cast
of the sequence as we allow only the "last cast" to be used outside the
induction update chain itself).

This is the last step in addressing PR30654.

llvm-svn: 320672
2017-12-14 07:56:31 +00:00
..
CMakeLists.txt [LV] Fix PR34248 - recommit D32871 after revert r311304 2017-08-27 12:55:46 +00:00
LLVMBuild.txt Update libdeps since TLI was moved from Target to Analysis in r226078. 2015-01-15 05:21:00 +00:00
LoadStoreVectorizer.cpp Add an @llvm.sideeffect intrinsic 2017-11-08 21:59:51 +00:00
LoopVectorize.cpp [LV] Support efficient vectorization of an induction with redundant casts 2017-12-14 07:56:31 +00:00
SLPVectorizer.cpp [SLP] Vectorize jumbled memory loads. 2017-12-13 03:08:29 +00:00
Vectorize.cpp Remove redundant includes from lib/Transforms. 2017-12-13 21:31:01 +00:00
VPlan.cpp [LV] Model masking in VPlan, introducing VPInstructions 2017-11-20 12:01:47 +00:00
VPlan.h [LV] Model masking in VPlan, introducing VPInstructions 2017-11-20 12:01:47 +00:00
VPlanBuilder.h [LV] Model masking in VPlan, introducing VPInstructions 2017-11-20 12:01:47 +00:00
VPlanValue.h [LV] Model masking in VPlan, introducing VPInstructions 2017-11-20 12:01:47 +00:00