[llvm-dev] [RFC] A new intrinsic, `llvm.blackbox`, to explicitly prevent constprop, die, etc optimizations

Joerg Sonnenberger via llvm-dev llvm-dev at lists.llvm.org
Fri Nov 6 08:35:18 PST 2015


On Fri, Nov 06, 2015 at 10:31:23AM -0600, Richard Diamond via llvm-dev wrote:
> On Tue, Nov 3, 2015 at 2:50 PM, Diego Novillo <dnovillo at google.com> wrote:
> 
> > I don't see how this is any different from volatile markers on
> > loads/stores or memory barriers or several other optimizer blocking
> > devices.  They generally end up crippling the optimizers without much added
> > benefit.
> >
> 
> Volatile must touch memory (right?). Memory is slow.

No, it just must not be optimised away. The CPU is still free to cache
it.

Joerg


More information about the llvm-dev mailing list