<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Feb 28, 2012, at 8:41 AM, Chris Lattner <<a href="mailto:clattner@apple.com">clattner@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Feb 27, 2012, at 8:43 PM, Chandler Carruth wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div class="gmail_quote">On Mon, Feb 27, 2012 at 8:27 PM, Pete Cooper <span dir="ltr"><<a href="mailto:peter_cooper@apple.com">peter_cooper@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
DSE: Shorten memset when a later store overwrites the start of it</blockquote></div><div><br></div><div>Not 100% sure I understand the comments, but this won't shorten the memset if its address has favorable alignment constraints, or this would make a vector store become a scalar store? It would be good to have some test cases to clearly demonstrate where this should and shouldn't fire there... It might be that I've misread them, but I only see fairly limited testing of the negative cases here. (Perhaps just comments on what the test cases are actually checking would help...)</div></blockquote><br></div><div>FWIW, it's important that we don't sacrifice alignment to save a few bytes stored.  When we get something like this:</div><div><a href="http://nondot.org/sabre/LLVMNotes/BetterStructureCopyOptimization.txt">http://nondot.org/sabre/LLVMNotes/BetterStructureCopyOptimization.txt</a></div></div></blockquote>Yeah, i agree.  In my case i'm actually not sacrificing alignment, but i admit both the comments and the checks in the code (and the tests!) need some work.  As Chandler said, i need far more tests, especially around vectors.</div><div><br></div><div>Pete<br><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br></div><div>it will be straight-forward to model this properly without breaking alignment (by saying that the first few bytes are undefined).</div><div><br></div><div>-Chris</div><br></div></blockquote></div><br></body></html>