[LLVMdev] LLVM 2.8 and MMX

Bruno Cardoso Lopes
Wed, 22 Sep 2010 15:49:22 -0000

Assign the bug to me and I'll fix it in TOT next week! Thanks for
narrowing it down!

On Wednesday, September 22, 2010, Nicolas Capens
<nicolas.capens at gmail.com> wrote:
> Hi all,
>
> I think I figured it out:
> 112804 causes 64-bit UNPCKLBW to no longer be selected for certain cases.
> 112805 is benign.
> 112806 causes 64-bit UNPCKHBW to no longer be selected for certain cases.
>
> I've attached a potential fix for the 2.8 branch.
>
> The real problem is that the code above it which checks for
> isUNPCK[L|H]_v_undef_Mask cases is only for when OptForSize is true. It
> assumes that otherwise things can get lowered to PSHUFD (which is true for
> v4i32 and v4f32 but nothing else - in particular MMX operations).
>
> I'll file a bug now...
>
> Nicolas
>
>
> -----Original Message-----
> From: Dale Johannesen [mailto:dalej at apple.com]
> Sent: Wednesday, September 22, 2010 2:37
> To: Bill Wendling
> Cc: Dale Johannesen; Reid Kleckner; Nicolas Capens; LLVM Developers Mailing
> List
> Subject: Re: [LLVMdev] LLVM 2.8 and MMX
>
>
> On Sep 21, 2010, at 5:30 PMPDT, Bill Wendling wrote:
>
>> LLVM isn't going to stop generating MMX instructions all together.
We
> can't do that. :-) If the user specifically wants MMX (by, say, using
the
> builtins), we have to support that still. The plan to cease generating MMX
> for generic vectors is a work-in-progress right now. It's not in 2.8.
>>
>> -bw
>
> Right, early on there was speculation that the early phases of this work
> were causing the problem Nicolas is seeing, but it now appears that that
> problem is unrelated.
>
>> On Sep 21, 2010, at 4:24 PM, Reid Kleckner wrote:
>>
>>> This thread confuses me.  I thought Chris said that LLVM 2.8 will
not
>>> lower generic vectors to MMX because it breaks x87 code, and I
didn't
>>> see an answer to your question about a switch to tell the code
>>> generator otherwise.  However, you're complaining that MMX
performance
>>> is subpar, even though LLVM 2.8 isn't supposed to generate MMX
>>> instructions.
>>>
>>> Can someone clarify the situation for me?
>>>
>>> Thanks,
>>> Reid
>>>
>>> On Tue, Sep 21, 2010 at 6:13 PM, Nicolas Capens
>>> <nicolas.capens at gmail.com> wrote:
>>>> Hi Dale,
>>>>
>>>> I suspect that these patches were intended to improve 128-bit
vector
>>>> performance but caused certain 64-bit vector operations to no
longer
> lower
>>>> to MMX instructions. Anyway, now that I've narrowed it down
to these
> patches
>>>> I think I can narrow it down further to a specific case so I
can file a
>>>> bug...
>>>>
>>>> Will Bruno be back soon or is he no longer working on the
project for
> good?
>>>>
>>>> Cheers,
>>>>
>>>> Nicolas
>>>>
>>>>
>>>> -----Original Message-----
>>>> From: Dale Johannesen [mailto:dalej at apple.com]
>>>> Sent: Tuesday, September 21, 2010 20:12
>>>> To: Nicolas Capens
>>>> Cc: Dale Johannesen; 'Chris Lattner'; 'Eli
Friedman';
> llvmdev at cs.uiuc.edu
>>>> Subject: Re: [LLVMdev] LLVM 2.8 and MMX
>>>>
>>>>
>>>> On Sep 21, 2010, at 10:23 AMPDT, Nicolas Capens wrote:
>>>>
>>>>> Hi all,
>>>>>
>>>>> Sorry for the late reply. I got sidetracked by other fun
projects. ;-)
>>>>>
>>>>> I found that the performance regression is caused by
revisions 112804,
>>>>> 112805 and 112806. Those changes were made 2 days prior to
the 2.8
>>>>> branching, so it may have not been the intention to include
them there?
>>>>> Either way they make my vector-intensive code two times
slower so it
> would
>>>>> be much appreciated to revert these changes for the 2.8
release.
>>>>>
>>>>> Thanks,
>>>>>
>>>>> Nicolas
>>>>
>>>> Interesting.  These are all Bruno's patches, and I'm
pretty sure they
>>>> weren't intended to affect MMX.   I doubt reverting them is
right since
> the
>>>> effect on SSE is presumably positive.  Unfortunately Bruno is
not here
> any
>>>> more.
>>>>
>>>>> -----Original Message-----
>>>>> From: Chris Lattner [mailto:clattner at apple.com]
>>>>>>
>>>>>> I think some changes related to MMX landed before 2.8
branched which
>>>>>> shouldn't have... please file a bug.
>>>>
>>>> So please file a bug, with example.
>>>>
>>>>
>>>> _______________________________________________
>>>> LLVM Developers mailing list
>>>> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
>>>>
http://lists.c <http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev>

--
Bruno Cardoso Lopes