[llvm-commits] [llvm] r155468 - in /llvm/trunk: lib/Transforms/InstCombine/InstCombineCalls.cpp test/Transforms/InstCombine/2012-04-23-Neon-Intrinsics.ll

Chandler Carruth chandlerc at google.com
Mon Apr 30 15:35:19 PDT 2012


On Mon, Apr 30, 2012 at 2:56 PM, Lang Hames <lhames at gmail.com> wrote:

> Hi all,
>
> 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.
>
> Thoughts?
>
> 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.
>

This looks like a fine location for the logic.

The constant code looks good. I have some questions about the non-constant
side:

+    //

?

+    if (PatternMatch::match(Arg1, PatternMatch::m_Zero())) {

Usually, the PatternMatch prefix is omitted. Look for other uses of 'match'.


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?

Anyways, not a big deal either way. If it makes the code simpler this way
for some reason, carry on. =]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120430/451ca2fd/attachment.html>


More information about the llvm-commits mailing list