First Last Prev Next    No search results available
Details
: [vmcore/performance] LLVM needs a new ConstantAggregateZe...
Bug#: 239
: libraries
: Core LLVM classes
Status: RESOLVED
Resolution: FIXED
: All
: All
: 1.0
: P2
: normal
: 1.2

:
: quality-of-implementation
:
:
  Show dependency tree - Show dependency graph
People
Reporter: Chris Lattner <sabre@nondot.org>
Assigned To: Chris Lattner <sabre@nondot.org>
:

Attachments


Note

You need to log in before you can comment on or make changes to this bug.

Related actions


Description:   Opened: 2004-02-14 21:01
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
------- Comment #1 From Chris Lattner 2004-02-14 21:02:40 -------
I vaguely remember Reid insisting that we needed something like this.  I guess
he gets to say i-told-you-so now. :)

-Chris
------- Comment #2 From Chris Lattner 2004-02-14 21:11:26 -------
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
------- Comment #3 From Reid Spencer 2004-02-14 21:22:09 -------
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?

------- Comment #4 From Chris Lattner 2004-02-14 21:59:01 -------
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
------- Comment #5 From Chris Lattner 2004-02-14 23:58:12 -------
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
------- Comment #6 From Reid Spencer 2004-02-15 00:09:52 -------
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 ...
------- Comment #7 From Chris Lattner 2004-02-29 14:23:28 -------
*** Bug 265 has been marked as a duplicate of this bug. ***

First Last Prev Next    No search results available