llvm-project/llvm/lib/Transforms
Max Kazantsev dc80366d52 [ScalarEvolution] Apply Depth limit to getMulExpr
This is a fix for PR33292 that shows a case of extremely long compilation
of a single .c file with clang, with most time spent within SCEV.

We have a mechanism of limiting recursion depth for getAddExpr to avoid
long analysis in SCEV. However, there are calls from getAddExpr to getMulExpr
and back that do not propagate the info about depth. As result of this, a chain

  getAddExpr -> ... .> getAddExpr -> getMulExpr -> getAddExpr -> ... -> getAddExpr

can be extremely long, with every segment of getAddExpr's being up to max depth long.
This leads either to long compilation or crash by stack overflow. We face this situation while
analyzing big SCEVs in the test of PR33292.

This patch applies the same limit on max expression depth for getAddExpr and getMulExpr.

Differential Revision: https://reviews.llvm.org/D33984

llvm-svn: 305463
2017-06-15 11:48:21 +00:00
..
Coroutines Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
Hello Add auto-exporting of symbols from tools so that plugins work on Windows 2016-05-26 11:16:43 +00:00
IPO Revert r305313 & r305303, self-hosting build-bot isn’t liking it. 2017-06-13 19:05:24 +00:00
InstCombine [InstCombine] lshr (sext iM X to iN), N-M --> zext (ashr X, min(N-M, M-1)) to iN 2017-06-12 14:23:43 +00:00
Instrumentation Fixing section name for Darwin platforms for sanitizer coverage 2017-06-14 23:40:25 +00:00
ObjCARC Sort the remaining #include lines in include/... and lib/.... 2017-06-06 11:49:48 +00:00
Scalar NewGVN: This is wrong by inspection, it will not cause an issue currently due to other limitations, i believe. This also means i can't make a test for it. 2017-06-14 21:19:28 +00:00
Utils [ScalarEvolution] Apply Depth limit to getMulExpr 2017-06-15 11:48:21 +00:00
Vectorize [LoopVectorize] Don't preserve nsw/nuw flags on shrunken ops. 2017-06-09 03:56:15 +00:00
CMakeLists.txt [coroutines] Part 3 of N: Adding Boilerplate for Coroutine Passes 2016-07-28 21:04:31 +00:00
LLVMBuild.txt [coroutines] Part 3 of N: Adding Boilerplate for Coroutine Passes 2016-07-28 21:04:31 +00:00