[LLVMdev] XOR Optimization

Bruno Cardoso Lopes bruno.cardoso at gmail.com
Thu Jul 28 14:56:22 PDT 2011


Hi Daniel,

I'm not the best person to review your patch but a couple of things:

1) Also attach a testcase as in test/Transforms/InstCombine
2) Generate your patch from svn "TOT"
3) Send patches directly to llvm-commits


2011/7/28 Daniel Nicácio <dnicacios at gmail.com>

> Hey guys,
>
> I still think there is no optimization doing what I want. When the loop is
> unrolled 32 times, llvm is able to identify that the loop is working on a
> whole word, it finds some constants and propagate them, resulting in the
> folded XOR instruction. However, when the loop operates on some bits of the
> word, llvm is still not able to fold those XOR, even when the operated bits
> does not overlap each other.
>
> Therefore, I am implementing the following optimization for folding XOR
> instructions working on bits (it still must be extended to OR and AND
> instructions). Any comments and critics are appreciated.
>
> Basically, I try to identify a chain of XOR instructions and fold it. The
> below image illustrate this:
>
> [image: XORChain.png]
>
> In order to do that I am adding an additional function call to "visitXor()"
> in Instruction Combining.
>
> My Optimization function is attached as a patch file. (the diff was made
> using the 2.9 release version of llvm).
>
> Thanks
>
> Daniel Nicacio
>
>
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
>


-- 
Bruno Cardoso Lopes
http://www.brunocardoso.cc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110728/dc105a09/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: XORChain.png
Type: image/png
Size: 59953 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110728/dc105a09/attachment.png>


More information about the llvm-dev mailing list