Hi all, I think I found a regression in the shuffle instruction. I've attached a replacement of fibonacci.cpp to reproduce the issue. It runs fine on release 2.3 but revision 52648 fails, and I suspect that the issue is still present. 2.3 generates the following x86 code: 03A10010 push ebp 03A10011 mov ebp,esp 03A10013 and esp,0FFFFFFF0h 03A10019 movups xmm0,xmmword ptr ds:[141D280h] 03A10020 xorps xmm1,xmm1 03A10023 movaps xmm2,xmm0 03A10026 shufps xmm2,xmm1,32h 03A1002A movaps xmm1,xmm0 03A1002D shufps xmm1,xmm2,84h 03A10031 shufps xmm0,xmm1,23h 03A10035 shufps xmm1,xmm1,40h 03A10039 shufps xmm1,xmm0,2Eh 03A1003D movups xmmword ptr ds:[14262C0h],xmm1 03A10044 mov esp,ebp 03A10046 pop ebp 03A10047 ret While 52648 generates this: 03C60010 push ebp 03C60011 mov ebp,esp 03C60013 and esp,0FFFFFFF0h 03C60019 movups xmm0,xmmword ptr ds:[148E280h] 03C60020 xorps xmm1,xmm1 03C60023 movaps xmm2,xmm0 03C60026 shufps xmm2,xmm1,32h 03C6002A movaps xmm1,xmm0 03C6002D shufps xmm1,xmm2,84h 03C60031 shufps xmm1,xmm1,40h 03C60035 psrldq xmm0,0Ch 03C6003A shufps xmm1,xmm0,2Eh 03C6003E movups xmmword ptr ds:[148E280h],xmm1 03C60045 mov esp,ebp 03C60047 pop ebp 03C60048 ret As I'm not using any optimization passes in this one I suspect that the issue is somewhere in instruction selection. Note the questionable use of the psrldq instruction. If anyone could have a look at this that would be great. I'll try to narrow down the change that caused this regression. Cheers, Nicolas Capens -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20080712/b5e5a950/attachment.html> -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: fibonacci.cpp URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20080712/b5e5a950/attachment.ksh>
I have fixed a related bug: 52740. Can you check if that fixes this problem? Evan On Jul 11, 2008, at 6:43 PM, Nicolas Capens wrote:> Hi all, > > I think I found a regression in the shuffle instruction. I’ve > attached a replacement of fibonacci.cpp to reproduce the issue. It > runs fine on release 2.3 but revision 52648 fails, and I suspect > that the issue is still present. > > 2.3 generates the following x86 code: > > 03A10010 push ebp > 03A10011 mov ebp,esp > 03A10013 and esp,0FFFFFFF0h > 03A10019 movups xmm0,xmmword ptr ds:[141D280h] > 03A10020 xorps xmm1,xmm1 > 03A10023 movaps xmm2,xmm0 > 03A10026 shufps xmm2,xmm1,32h > 03A1002A movaps xmm1,xmm0 > 03A1002D shufps xmm1,xmm2,84h > 03A10031 shufps xmm0,xmm1,23h > 03A10035 shufps xmm1,xmm1,40h > 03A10039 shufps xmm1,xmm0,2Eh > 03A1003D movups xmmword ptr ds:[14262C0h],xmm1 > 03A10044 mov esp,ebp > 03A10046 pop ebp > 03A10047 ret > > While 52648 generates this: > > 03C60010 push ebp > 03C60011 mov ebp,esp > 03C60013 and esp,0FFFFFFF0h > 03C60019 movups xmm0,xmmword ptr ds:[148E280h] > 03C60020 xorps xmm1,xmm1 > 03C60023 movaps xmm2,xmm0 > 03C60026 shufps xmm2,xmm1,32h > 03C6002A movaps xmm1,xmm0 > 03C6002D shufps xmm1,xmm2,84h > 03C60031 shufps xmm1,xmm1,40h > 03C60035 psrldq xmm0,0Ch > 03C6003A shufps xmm1,xmm0,2Eh > 03C6003E movups xmmword ptr ds:[148E280h],xmm1 > 03C60045 mov esp,ebp > 03C60047 pop ebp > 03C60048 ret > > As I’m not using any optimization passes in this one I suspect that > the issue is somewhere in instruction selection. Note the > questionable use of the psrldq instruction. > > If anyone could have a look at this that would be great. I’ll try to > narrow down the change that caused this regression… > > Cheers, > > Nicolas Capens > <fibonacci.cpp> > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20080711/eef77247/attachment.html>
52740 indeed fixes it. Thank you! _____ From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On Behalf Of Evan Cheng Sent: Saturday, 12 July, 2008 4:28 To: LLVM Developers Mailing List Subject: Re: [LLVMdev] Shuffle regression I have fixed a related bug: 52740. Can you check if that fixes this problem? Evan On Jul 11, 2008, at 6:43 PM, Nicolas Capens wrote: Hi all, I think I found a regression in the shuffle instruction. I've attached a replacement of fibonacci.cpp to reproduce the issue. It runs fine on release 2.3 but revision 52648 fails, and I suspect that the issue is still present. 2.3 generates the following x86 code: 03A10010 push ebp 03A10011 mov ebp,esp 03A10013 and esp,0FFFFFFF0h 03A10019 movups xmm0,xmmword ptr ds:[141D280h] 03A10020 xorps xmm1,xmm1 03A10023 movaps xmm2,xmm0 03A10026 shufps xmm2,xmm1,32h 03A1002A movaps xmm1,xmm0 03A1002D shufps xmm1,xmm2,84h 03A10031 shufps xmm0,xmm1,23h 03A10035 shufps xmm1,xmm1,40h 03A10039 shufps xmm1,xmm0,2Eh 03A1003D movups xmmword ptr ds:[14262C0h],xmm1 03A10044 mov esp,ebp 03A10046 pop ebp 03A10047 ret While 52648 generates this: 03C60010 push ebp 03C60011 mov ebp,esp 03C60013 and esp,0FFFFFFF0h 03C60019 movups xmm0,xmmword ptr ds:[148E280h] 03C60020 xorps xmm1,xmm1 03C60023 movaps xmm2,xmm0 03C60026 shufps xmm2,xmm1,32h 03C6002A movaps xmm1,xmm0 03C6002D shufps xmm1,xmm2,84h 03C60031 shufps xmm1,xmm1,40h 03C60035 psrldq xmm0,0Ch 03C6003A shufps xmm1,xmm0,2Eh 03C6003E movups xmmword ptr ds:[148E280h],xmm1 03C60045 mov esp,ebp 03C60047 pop ebp 03C60048 ret As I'm not using any optimization passes in this one I suspect that the issue is somewhere in instruction selection. Note the questionable use of the psrldq instruction. If anyone could have a look at this that would be great. I'll try to narrow down the change that caused this regression. Cheers, Nicolas Capens <fibonacci.cpp> _______________________________________________ LLVM Developers mailing list LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20080714/8ee21e60/attachment.html>
Apparently Analagous Threads
- [LLVMdev] Shuffle regression
- [LLVMdev] RFB: Would like to flip the vector shuffle legality flag
- [LLVMdev] RFB: Would like to flip the vector shuffle legality flag
- [LLVMdev] RFB: Would like to flip the vector shuffle legality flag
- [LLVMdev] RFB: Would like to flip the vector shuffle legality flag