summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
diff options
context:
space:
mode:
authorWei Mi <wmi@google.com>2017-04-17 20:40:05 +0000
committerWei Mi <wmi@google.com>2017-04-17 20:40:05 +0000
commit8c4053372efb310560787e3beff07c41760dfdab (patch)
treefe07c84026274657609de152b659c51b9ca50f5b /llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
parent9083dc96801bdeb10bc639b6effacfd29d3859ad (diff)
downloadbcm5719-llvm-8c4053372efb310560787e3beff07c41760dfdab.tar.gz
bcm5719-llvm-8c4053372efb310560787e3beff07c41760dfdab.zip
[SCEV] Add a local cache for getZeroExtendExpr and getSignExtendExpr to prevent
the exponential behavior. The patch is to fix PR32043. Functions getZeroExtendExpr and getSignExtendExpr may call themselves recursively more than once. This is potentially a 2^N complexity behavior. The exponential behavior was not commonly exposed before because of existing global cache mechnism like UniqueSCEVs or some early return mechanism when flags FlagNSW or FlagNUW are seen. However, we still have case which can expose the exponential behavior, like the case in PR32043, so we add a local cache in getZeroExtendExpr and getSignExtendExpr. If the input of the functions -- SCEV and type pair have been seen before, we can find the extended expression directly in the local cache. Differential Revision: https://reviews.llvm.org/D30350 llvm-svn: 300494
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud