<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Apr 24, 2017 at 10:23 AM, David Jones via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>How do you disable optimization for a function?<br><br></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><br></div><div>In a lot of cases, we'd rather just fix these optimizers.</div><div>There is no reason, for example, for DSE to be N^2.</div><div><br></div><div>There are some that are not fixable, but ...</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div> 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><br></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></div></blockquote><div><br></div><div>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><br></div></div></div></div>