forked from OSchip/llvm-project
b07369651e
At the point when we perform `emitTransformedIndex`, we have a broken IR (in particular, we have Phis for which not every incoming value is properly set). On such IR, it is illegal to create SCEV expressions, because their internal simplification process may try to prove some predicates and break when it stumbles across some broken IR. The only purpose of using SCEV in this particular place is attempt to simplify the generated code slightly. It seems that the result isn't worth it, because some trivial cases (like addition of zero and multiplication by 1) can be handled separately if needed, but more generally InstCombine is able to achieve the goals we want to achieve by using SCEV. This patch fixes a functional crash described in PR39160, and as side-effect it also generates a bit smarter code in some simple cases. It also may cause some optimality loss (i.e. we will now generate `mul` by power of `2` instead of shift etc), but there is nothing what InstCombine could not handle later. In case of dire need, we can support more trivial cases just in place. Note that this patch only fixes one particular case of the general problem that LV misuses SCEV, attempting to create SCEVs or prove predicates on invalid IR. The general solution, however, seems complex enough. Differential Revision: https://reviews.llvm.org/D52881 Reviewed By: fhahn, hsaito llvm-svn: 343954 |
||
---|---|---|
.. | ||
CMakeLists.txt | ||
LLVMBuild.txt | ||
LoadStoreVectorizer.cpp | ||
LoopVectorizationLegality.cpp | ||
LoopVectorizationPlanner.h | ||
LoopVectorize.cpp | ||
SLPVectorizer.cpp | ||
VPRecipeBuilder.h | ||
VPlan.cpp | ||
VPlan.h | ||
VPlanDominatorTree.h | ||
VPlanHCFGBuilder.cpp | ||
VPlanHCFGBuilder.h | ||
VPlanHCFGTransforms.cpp | ||
VPlanHCFGTransforms.h | ||
VPlanLoopInfo.h | ||
VPlanValue.h | ||
VPlanVerifier.cpp | ||
VPlanVerifier.h | ||
Vectorize.cpp |