[llvm-commits] [llvm] r50940 - in /llvm/trunk: lib/Target/X86/X86ISelLowering.cpp test/CodeGen/X86/2008-05-09-ShuffleLoweringBug.ll

Evan Cheng evan.cheng at apple.com
Fri May 9 23:46:49 PDT 2008


Author: evancheng
Date: Sat May 10 01:46:49 2008
New Revision: 50940

URL: http://llvm.org/viewvc/llvm-project?rev=50940&view=rev
Log:
When transforming a vector_shuffle to a load, the base address must not be an undef.

Added:
    llvm/trunk/test/CodeGen/X86/2008-05-09-ShuffleLoweringBug.ll
Modified:
    llvm/trunk/lib/Target/X86/X86ISelLowering.cpp

Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=50940&r1=50939&r2=50940&view=diff

==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Sat May 10 01:46:49 2008
@@ -6283,6 +6283,8 @@
       return false;
     if (!Base) {
       Base = Elt.Val;
+      if (Base->getOpcode() == ISD::UNDEF)
+        return false;
       continue;
     }
     if (Elt.getOpcode() == ISD::UNDEF)

Added: llvm/trunk/test/CodeGen/X86/2008-05-09-ShuffleLoweringBug.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2008-05-09-ShuffleLoweringBug.ll?rev=50940&view=auto

==============================================================================
--- llvm/trunk/test/CodeGen/X86/2008-05-09-ShuffleLoweringBug.ll (added)
+++ llvm/trunk/test/CodeGen/X86/2008-05-09-ShuffleLoweringBug.ll Sat May 10 01:46:49 2008
@@ -0,0 +1,10 @@
+; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2
+
+define fastcc void @glgVectorFloatConversion() nounwind  {
+	%tmp12745 = load <4 x float>* null, align 16		; <<4 x float>> [#uses=1]
+	%tmp12773 = insertelement <4 x float> %tmp12745, float 1.000000e+00, i32 1		; <<4 x float>> [#uses=1]
+	%tmp12774 = insertelement <4 x float> %tmp12773, float 0.000000e+00, i32 2		; <<4 x float>> [#uses=1]
+	%tmp12775 = insertelement <4 x float> %tmp12774, float 1.000000e+00, i32 3		; <<4 x float>> [#uses=1]
+	store <4 x float> %tmp12775, <4 x float>* null, align 16
+	unreachable
+}





More information about the llvm-commits mailing list