[llvm-commits] [patch] Minor X86CodeEmitter Memory Foot Reduction

Aaron Gray aaronngray.lists at googlemail.com
Mon Jul 6 13:17:05 PDT 2009


> On Mon, Jul 6, 2009 at 4:11 PM, Evan Cheng<evan.cheng at apple.com> wrote:
>> Sorry, I am missing some context. Why is each of the emitter a separate
>> template instantiation in the first place? Why can't the code in
>
> This happens because ObjectCodeEmitter is a lot simpler than 
> JITCodeEmitter and
> we don't need to deal with CurrBufferBegin, GVStub*, and so on.
>
>> X86CodeEmitter.cpp be shared across all 3?
>
> I agree with Evan, I don't see why this code shouldn't be shared,
> besides that, putting
> all that code in a header file doesn't seems like the right approach.

> On Mon, Jul 6, 2009 at 4:11 PM, Evan Cheng<evan.cheng at apple.com> wrote:
>> Sorry, I am missing some context. Why is each of the emitter a separate
>> template instantiation in the first place? Why can't the code in
>
> This happens because ObjectCodeEmitter is a lot simpler than 
> JITCodeEmitter and
> we don't need to deal with CurrBufferBegin, GVStub*, and so on.
>
>> X86CodeEmitter.cpp be shared across all 3?
>
> I agree with Evan, I don't see why this code shouldn't be shared,
> besides that, putting
> all that code in a header file doesn't seems like the right approach.

Its the right approach.

It allows us to have separate object modules thus reducing memory overheads 
for other projects that at least one other person has been asking for.

Putting templated code in headers and instatiating separately in .cpp files 
is quite common practice once you use templating alot.

Aaron




More information about the llvm-commits mailing list