[llvm-commits] [llvm] r130428 - /llvm/trunk/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp

Duncan Sands baldrick at free.fr
Thu Apr 28 13:20:04 PDT 2011


Hi Benjamin,

> -  // (trunc x) == C1&  (and x, CA) == C2 ->  (and CA|CMAX) == C1|C2
> +  // (trunc x) == C1&  (and x, CA) == C2 ->  (and x, CA|CMAX) == C1|C2
>     // where CMAX is the all ones value for the truncated type,
>     // iff the lower bits of CA are zero.

don't you need the lower bits of C2 to also be zero?

Ciao,

Duncan.

PS: Of course, if they are not zero then "(and x, CA) == C2" can be folded to
false, so probably you will never hit this in practice.



More information about the llvm-commits mailing list