<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Apr 24, 2017, at 11:00 AM, Daniel Berlin <<a href="mailto:dberlin@dberlin.org" class="">dberlin@dberlin.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><br class=""><div class="gmail_extra"><br class=""><div class="gmail_quote">On Mon, Apr 24, 2017 at 10:23 AM, David Jones via llvm-dev <span dir="ltr" class=""><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank" class="">llvm-dev@lists.llvm.org</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class=""><div class=""><div class="">How do you disable optimization for a function?<br class=""><br class=""></div>I ask because my application often compiles machine-generated code that results in pathological structures that take a long time to optimize, for little benefit. As an example, if a basic block has over a million instructions in it, then DSE can take a while, as it is O(n^2) in the number of instructions in the block.</div></div></blockquote><div class=""><br class=""></div><div class="">In a lot of cases, we'd rather just fix these optimizers.</div><div class="">There is no reason, for example, for DSE to be N^2.</div><div class=""><br class=""></div><div class="">There are some that are not fixable, but ...</div><div class=""><br class=""></div><div class=""> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class=""><div class=""> In my application (at least), this block is typically executed only once at run time, and is not part of a loop, so I really don't care about code quality for that block.<br class=""><br class=""></div>I am able to identify some of these conditions. I would like to tell LLVM to "not try so hard" on the pathological blocks, while keeping optimizations active for ordinary cases.<br class=""></div></blockquote><div class=""><br class=""></div><div class="">This is a use case i believe where we'd rather integrate smart limits into LLVM itself, rather than try to have people control it this way :)</div></div></div></div></div></blockquote><br class=""></div><div>I completely agree!</div><div><br class=""></div><div>Would be cool to create a suite of extreme inputs, maybe a special llvm test-suite module. This module would contain scripts that produce extreme inputs (long basic blocks, deeply nested loops, utils/create_ladder_graph.py, etc.) In fact I have a python script here as well that generates a few variations of stuff that was interesting to scheduling algos. It would just take someone to setup a proper test-suite and a bot for it and I'd happily contribute more tests :)</div><div><br class=""></div><div>- Matthias</div></body></html>