[llvm-commits] [PATCH] AndOrXor Chain Optimization

Daniel Nicácio dnicacios at gmail.com
Thu Aug 4 14:58:27 PDT 2011


Hi, this patch increments the instcombiner pass.
It adds a new XOR, OR, AND optimization, trying to find a chain of logical
instructions (xor, and, or) operating on different bits of the same word. If
this chain is found, it is collapsed into a single logical instruction.
The figure below shows a generic example:

[image: XORChain.png]

Any comments and critics are welcome.

Thanks,

Daniel Nicacio
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20110804/00f7d61e/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-commits/attachments/20110804/00f7d61e/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: InstCOmbine.h.diff
Type: application/octet-stream
Size: 358 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20110804/00f7d61e/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: InstCombineAndOrXor.cpp.diff
Type: application/octet-stream
Size: 171 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20110804/00f7d61e/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: InstructionCombining.cpp.diff
Type: application/octet-stream
Size: 7316 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20110804/00f7d61e/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: testCase.ll
Type: application/octet-stream
Size: 1213 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20110804/00f7d61e/attachment-0003.obj>


More information about the llvm-commits mailing list