<div class="gmail_quote">On Mon, Apr 30, 2012 at 2:56 PM, Lang Hames <span dir="ltr"><<a href="mailto:lhames@gmail.com" target="_blank">lhames@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi all,<div><br></div><div>Here's an updated version of the vmull simplification patch. I believe it addresses the concerns discussed earlier: It doesn't create any new instructions, and only simplifies if the new expression would be a constant or a single ext instruction.</div>

<div><br></div><div>Thoughts?</div><div><br></div><div>I've just thrown the widening mul logic into visitCallInst for now, which seems consistent with how the other intrinsics are dealt with. If anyone can think of other clients for this kind of widening-mul simplification I'd be happy to refactor.</div>
</blockquote><div><br></div><div>This looks like a fine location for the logic.</div><div><br></div><div>The constant code looks good. I have some questions about the non-constant side:</div><div><br></div><div>+    // </div>
<div><br></div><div>?</div><div><br></div><div>+    if (PatternMatch::match(Arg1, PatternMatch::m_Zero())) {</div><div><br></div><div>Usually, the PatternMatch prefix is omitted. Look for other uses of 'match'.</div>
<div><br></div><div><br></div><div>However, at a fundamental level, why do we need to specially handle Zero vs. One? Couldn't we handle this inside the constant logic, when we find only one side with zero or one? Don't know that it's worth building up a full pattern matcher just to select these two patterns when we already have the zero and one extracted?</div>
<div><br></div><div>Anyways, not a big deal either way. If it makes the code simpler this way for some reason, carry on. =]</div></div>