aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/LoopUtils.cpp
diff options
context:
space:
mode:
authorAlexey Lapshin <a.v.lapshin@mail.ru>2019-12-25 00:38:09 +0300
committerAlexey Lapshin <a.v.lapshin@mail.ru>2020-01-04 16:42:38 +0300
commit831bfcea47826a102ece03f0fad33ce39a73c672 (patch)
treebb7b1888d2d50532cbe19602ff2e6354b58cc843 /llvm/lib/Transforms/Utils/LoopUtils.cpp
parenteb0e1978df7b9e7df3e645bb48fbf655f8aab69a (diff)
downloadllvm-831bfcea47826a102ece03f0fad33ce39a73c672.zip
llvm-831bfcea47826a102ece03f0fad33ce39a73c672.tar.gz
llvm-831bfcea47826a102ece03f0fad33ce39a73c672.tar.bz2
[Transforms][GlobalSRA] huge array causes long compilation time and huge memory usage.
Summary: For artificial cases (huge array, few usages), Global SRA optimization creates a lot of redundant data. It creates an instance of GlobalVariable for each array element. For huge array, that means huge compilation time and huge memory usage. Following example compiles for 10 minutes and requires 40GB of memory. namespace { char LargeBuffer[64 * 1024 * 1024]; } int main ( void ) { LargeBuffer[0] = 0; printf("\n "); return LargeBuffer[0] == 0; } The fix is to avoid Global SRA for large arrays. Reviewers: craig.topper, rnk, efriedma, fhahn Reviewed By: rnk Subscribers: xbolva00, lebedev.ri, lkail, merge_guards_bot, hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D71993
Diffstat (limited to 'llvm/lib/Transforms/Utils/LoopUtils.cpp')
0 files changed, 0 insertions, 0 deletions