[LLVMdev] [cfe-dev] bitwise ops on booleans

Joerg Sonnenberger joerg at britannica.bec.de
Fri Jun 26 13:17:43 PDT 2015


On Fri, Jun 26, 2015 at 12:51:38PM -0600, Sanjay Patel wrote:
> Assuming the transform is correct, what is the recommended way to write
> this in C/C++ to achieve the desired effect: we want both comparisons to be
> evaluated (do *not* want short-circuiting)?

Why do you want that? As long as the evaluation of x and y is
side-effect free, the transform is valid and how the backend is lowering
is doesn't matter. Keep in mind that materializing the 0/1 bits is often
as expensive as doing a short-circuite jump.

Joerg



More information about the llvm-dev mailing list