[LLVMdev] Optimizing Boolean Expression

Ehsan Amiri ehsanamiri at gmail.com
Thu Jun 17 22:41:52 PDT 2010

> recursion limit so pathological cases don't blow the stack and/or
> cause very long running times.  In this particular case, I believe the
> limit is in llvm::ComputeMaskedBits.
> I did a few other tests, it does optimization upto six ORs and stops
optimizing when there are seven or more OR instructions.

> I don't think there's any way to make a pass perform this optimization
> without modifying the LLVM code or writing your own pass to perform
> it.  Is this really an important case for you?
> Optimizing Boolean expressions are really important for me. I may have long
straight lines of Boolean operations and then I may want to optimize based
on setting a variable to TRUE or FALSE. I think depths larger than six may
happen sometimes in my application.

Something extra that I may need is this. I have a line of code a  = b | c.
Now I know for some reason that a = FALSE. This implies that b = FALSE and c
= FALSE as well. Now I want to propagate all three values in the code and
simplify as much as possible. Does by any chance LLVM do this?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100617/7d0f71f8/attachment.html>

More information about the llvm-dev mailing list