llvm/lib
Wei Mi e35a5f5518 [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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300494 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-17 20:40:05 +00:00
..
Analysis [SCEV] Add a local cache for getZeroExtendExpr and getSignExtendExpr to prevent 2017-04-17 20:40:05 +00:00
AsmParser [IR] Take func, ret, and arg attrs separately in AttributeList::get 2017-04-13 00:58:09 +00:00
Bitcode Bitcode: Add missing build dep to fix shlib build. 2017-04-17 18:53:27 +00:00
CodeGen [CodeGenPrepare] Fix crash due to an invalid CFG 2017-04-17 19:11:04 +00:00
DebugInfo Add GNU_discriminator support for inline callsites in llvm-symbolizer. 2017-04-17 20:10:39 +00:00
Demangle Add support for demangling C++11 thread_local variables. 2017-01-31 15:56:36 +00:00
ExecutionEngine [ORC] Add RPC and serialization support for Errors and Expecteds. 2017-04-13 03:51:35 +00:00
Fuzzer [libFuzzer] XFAIL fuzzer-oom.test on Darwin. 2017-04-12 23:15:10 +00:00
IR [IR] Implement DataLayout::getPointerTypeSizeInBits using getPointerSizeInBits directly 2017-04-17 18:22:36 +00:00
IRReader
LibDriver Fix some ArgList uses after API change in r300135. 2017-04-12 23:43:58 +00:00
LineEditor
Linker [Linker] Provide callback for internalization 2017-03-13 18:08:11 +00:00
LTO Object, LTO: Add target triple to irsymtab and LTO API. 2017-04-14 02:55:06 +00:00
MC Distinguish between code pointer size and DataLayout::getPointerSize() in DWARF info generation 2017-04-17 17:41:25 +00:00
Object Object: Use offset+size as the irsymtab string representation. 2017-04-17 17:55:24 +00:00
ObjectYAML Add virtual destructor to WasmYAML::Section or avoid memory leak 2017-03-31 22:14:14 +00:00
Option ArgList: cache index ranges containing arguments with each ID 2017-04-12 23:19:51 +00:00
Passes MemorySSA: Move to Analysis, from Transforms/Utils. It's used as 2017-04-11 20:06:36 +00:00
ProfileData [ProfileData] Unify getInstrProf*SectionName helpers 2017-04-15 00:09:57 +00:00
Support [APInt] Fix a bug in lshr by a value more than 64 bits above the bit width. 2017-04-16 01:03:51 +00:00
TableGen Use print() instead of dump() in code 2017-01-28 02:47:46 +00:00
Target [WebAssembly] Encode block signatures as SLEB instead of ULEB 2017-04-17 20:28:28 +00:00
Transforms Bitcode: Add a string table to the bitcode format. 2017-04-17 17:51:36 +00:00
XRay [XRay] - Fix spelling error to test commit access. 2017-04-06 03:32:01 +00:00
CMakeLists.txt [XRay] Define the library for XRay trace logs 2017-01-11 06:39:09 +00:00
LLVMBuild.txt