[llvm-dev] A question about the widely used "xxx | true" inside llvm

Craig Topper via llvm-dev llvm-dev at lists.llvm.org
Wed Aug 22 21:48:04 PDT 2018


I believe Justin Bogner went ahead and changed all the lines in SimplifyCFG
to || in r340153.

~Craig


On Wed, Aug 22, 2018 at 9:30 PM Chris Lattner <clattner at nondot.org> wrote:

> On Aug 19, 2018, at 10:33 PM, Craig Topper via llvm-dev <
> llvm-dev at lists.llvm.org> wrote:
>
> The language requires both sides of the | need to be evaluated. The
> compiler can't remove the function call if it has side effects.
>
>
> Correct.  If you are somehow really bothered by this, we could also use:
>
> bool bar() {
>   return foo(), true;
> }
>
> -Chris
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180822/bd960b20/attachment.html>


More information about the llvm-dev mailing list