Richard Diamond via llvm-dev
2015-Nov-06 16:31 UTC
[llvm-dev] [RFC] A new intrinsic, `llvm.blackbox`, to explicitly prevent constprop, die, etc optimizations
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.> Would it be possible to stop the code motion you want to block by > explicitly exposing data dependencies? Or simply disabling some > optimizations with pragmas? > >Code motion would be fine in theory, though as has been proposed, this intrinsic would prevent it (because there isn't an attribute that doesn't allow dead code removal but still permits reordering, as far as I'm aware). Rust doesn't have pragmas, and besides, that would also affect the whole module (or the whole crate, to use Rust's vernacular), whereas this intrinsic would be used in a much more targeted manner (ie at the SSA value level) by the developer and leave the rest of the module unmolested. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20151106/f0d8f5e9/attachment.html>
Joerg Sonnenberger via llvm-dev
2015-Nov-06 16:35 UTC
[llvm-dev] [RFC] A new intrinsic, `llvm.blackbox`, to explicitly prevent constprop, die, etc optimizations
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
Richard Diamond via llvm-dev
2015-Nov-06 16:42 UTC
[llvm-dev] [RFC] A new intrinsic, `llvm.blackbox`, to explicitly prevent constprop, die, etc optimizations
On Fri, Nov 6, 2015 at 10:35 AM, Joerg Sonnenberger via llvm-dev < llvm-dev at lists.llvm.org> wrote:> 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. >Hm, okay. Well, at anyrate it isn't guaranteed; I will do some tests to check anyway. Joerg> _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20151106/5e177cfa/attachment.html>