[llvm-dev] Disable optimization on basic block level

Daniel Berlin via llvm-dev llvm-dev at lists.llvm.org
Mon Apr 24 11:00:56 PDT 2017


On Mon, Apr 24, 2017 at 10:23 AM, David Jones via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> How do you disable optimization for a function?
>
> 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.
>

In a lot of cases, we'd rather just fix these optimizers.
There is no reason, for example, for DSE to be N^2.

There are some that are not fixable, but ...



> 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.
>
> 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.
>

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 :)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170424/06c9015b/attachment.html>


More information about the llvm-dev mailing list