[LLVMdev] XOR Optimization

Duncan Sands baldrick at free.fr
Tue Jul 26 12:50:39 PDT 2011

Hi Daniel,

> Precisely. The code generated by unrolling can be folded into a single XOR and
> SHL. And even if it was not inside a loop, it can still be optimized. What I
> want to know is:  is there any optimization supposed to optimize this code, but
> for some reason it thinks it is not possible, or  there is no optimization for
> that situation at all?

it could be a phase ordering problem.  If you run "opt -std-compile-opts" on the
unsatisfactory bitcode, does it clean up all the bit fiddling?

Ciao, Duncan.

More information about the llvm-dev mailing list