Hi Daniel,<div><br></div><div>I'm not the best person to review your patch but a couple of things:</div><div><br></div><div>1) Also attach a testcase as in test/Transforms/InstCombine</div><div>2) Generate your patch from svn "TOT"</div>
<div>3) Send patches directly to llvm-commits<br><br></div><div><br><div class="gmail_quote">2011/7/28 Daniel Nicácio <span dir="ltr"><<a href="mailto:dnicacios@gmail.com">dnicacios@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hey guys,<div><br></div><div>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.</div>





<div><br></div><div>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.</div>





<div><br></div><div>Basically, I try to identify a chain of XOR instructions and fold it. The below image illustrate this:</div><div><br></div><div><img src="cid:ii_131720559750ceff" alt="XORChain.png" title="XORChain.png" width="420" height="348"><br>





</div><div><br></div><div>In order to do that I am adding an additional function call to "visitXor()" in Instruction Combining.</div><div><br></div><div>My Optimization function is attached as a patch file. (the diff was made using the 2.9 release version of llvm).</div>




<div><br></div><div><div>Thanks</div></div><div><br></div><div>Daniel Nicacio</div>
<div><br></div><div><br></div>
<br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Bruno Cardoso Lopes <br><a href="http://www.brunocardoso.cc">http://www.brunocardoso.cc</a><br>
</div>