Bugzilla – Bug 239
[vmcore/performance] LLVM needs a new ConstantAggregateZero class
Last modified: 2004-02-29 14:23:28
You need to log in before you can comment on or make changes to this bug.
Both 129.compress and 132.ijpeg have obsurdly large static global buffers in them. For example, ijpeg has a [16M x ubyte] jpeg_compressed_data array, and compress has several 69K arrays, a [128 x [128 x double ] ] zero array, and lots of zero [128 x int] arrays. The problem with these arrays is that we currently create ConstantArray objects for them with the indicated number of elements, taking memory proportional to the size of the object. Constructing these objects in the various LLVM tools is _really_ slow and consumes a TON of memory. Note that the .ll and .bc files encode zero initializers compactly (the CFE even emits them compactly now that Bug 205 is fixed), this is an LLVM core problem. Fixing this is straight-forward, simply introduce a ConstantAggregateZero class. The problem is that a lot of code assumes that if we have an array/struct and it's a constant, that it's a ConstantArray/ConstantStruct. This code can be fixed, it will just take time to do so. -Chris
I vaguely remember Reid insisting that we needed something like this. I guess he gets to say i-told-you-so now. :) -Chris
This patch fixes the incarnation of this problem in the C front-end: http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20040209/011699.html -Chris
I told you so! :) I noticed the problem in Stacker when it initializes its stack and various strings. I was just wanting it for char arrays initially, but if its a generic problem on any kind of global arrays, then we definitely want the solution you describe. Need any help making a massive edit?
Actually, I don't think the change will be that bad. It's more of a code audit than massive code change sort-of-thing. Kinda like the 256 member struct problem that I still need to get to. Perhaps I'll have something tonight... -Chris
This is now fixed. Compiling 129.compress and 132.ijpeg now no longer take hundreds of megabytes of memory. Here are the primary patches: http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20040209/011711.html http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20040209/011709.html -Chris
Cool! That was fast. I'm going to use this shortly as I'm just beginning to deal with various constant arrays in XPL. Off to compile ...
*** Bug 265 has been marked as a duplicate of this bug. ***