constant pooling in GHC

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

constant pooling in GHC

Phyx
Hi All,

I'm hoping someone here can save me some time.  I'm working on something that relies on constants in the same translation unit being pooled before assembly.

I've noticed GHC does some const pooling at -O1 , but this doesn't seem to be very consistent, which leads me to believe this is a byproduct of another optimization rather than an explicit thing.

I couldn't find anything obvious in the sources, so does GHC intentionally do constant pooling already? Or do I need a new pass to guarantee it.

Thanks,
Tamar

_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
Reply | Threaded
Open this post in threaded view
|

Re: constant pooling in GHC

Carter Schonwald
what precisely do you mean by constant pooling? i can guess several meanings, but what do you mean specifically?

On Sat, Sep 15, 2018 at 10:33 AM Phyx <[hidden email]> wrote:
Hi All,

I'm hoping someone here can save me some time.  I'm working on something that relies on constants in the same translation unit being pooled before assembly.

I've noticed GHC does some const pooling at -O1 , but this doesn't seem to be very consistent, which leads me to believe this is a byproduct of another optimization rather than an explicit thing.

I couldn't find anything obvious in the sources, so does GHC intentionally do constant pooling already? Or do I need a new pass to guarantee it.

Thanks,
Tamar
_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
Reply | Threaded
Open this post in threaded view
|

Re: constant pooling in GHC

Phyx
I simply mean that the same constant is not emitted more than once to memory. I.e. If a constant string is used twice, there is only one value in .rodata for it. 

On Fri, Sep 21, 2018, 01:20 Carter Schonwald <[hidden email]> wrote:
what precisely do you mean by constant pooling? i can guess several meanings, but what do you mean specifically?

On Sat, Sep 15, 2018 at 10:33 AM Phyx <[hidden email]> wrote:
Hi All,

I'm hoping someone here can save me some time.  I'm working on something that relies on constants in the same translation unit being pooled before assembly.

I've noticed GHC does some const pooling at -O1 , but this doesn't seem to be very consistent, which leads me to believe this is a byproduct of another optimization rather than an explicit thing.

I couldn't find anything obvious in the sources, so does GHC intentionally do constant pooling already? Or do I need a new pass to guarantee it.

Thanks,
Tamar
_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
Reply | Threaded
Open this post in threaded view
|

Re: constant pooling in GHC

Carter Schonwald
oh ok, so CSE / sharing for string and numerical literals?

On Fri, Sep 21, 2018 at 1:23 AM Phyx <[hidden email]> wrote:
I simply mean that the same constant is not emitted more than once to memory. I.e. If a constant string is used twice, there is only one value in .rodata for it. 

On Fri, Sep 21, 2018, 01:20 Carter Schonwald <[hidden email]> wrote:
what precisely do you mean by constant pooling? i can guess several meanings, but what do you mean specifically?

On Sat, Sep 15, 2018 at 10:33 AM Phyx <[hidden email]> wrote:
Hi All,

I'm hoping someone here can save me some time.  I'm working on something that relies on constants in the same translation unit being pooled before assembly.

I've noticed GHC does some const pooling at -O1 , but this doesn't seem to be very consistent, which leads me to believe this is a byproduct of another optimization rather than an explicit thing.

I couldn't find anything obvious in the sources, so does GHC intentionally do constant pooling already? Or do I need a new pass to guarantee it.

Thanks,
Tamar
_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs