Skip to content

Commit 1621e89

Browse files
committed
Merge from mainline.
When transforming a vector_shuffle to a load, the base address must not be an undef. llvm-svn: 50981
1 parent 797cb5b commit 1621e89

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

llvm/lib/Target/X86/X86ISelLowering.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6283,6 +6283,8 @@ static bool EltsFromConsecutiveLoads(SDNode *N, SDOperand PermMask,
62836283
return false;
62846284
if (!Base) {
62856285
Base = Elt.Val;
6286+
if (Base->getOpcode() == ISD::UNDEF)
6287+
return false;
62866288
continue;
62876289
}
62886290
if (Elt.getOpcode() == ISD::UNDEF)
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
; RUN: llvm-as < %s | llc -march=x86 -mattr=+sse2
2+
3+
define fastcc void @glgVectorFloatConversion() nounwind {
4+
%tmp12745 = load <4 x float>* null, align 16 ; <<4 x float>> [#uses=1]
5+
%tmp12773 = insertelement <4 x float> %tmp12745, float 1.000000e+00, i32 1 ; <<4 x float>> [#uses=1]
6+
%tmp12774 = insertelement <4 x float> %tmp12773, float 0.000000e+00, i32 2 ; <<4 x float>> [#uses=1]
7+
%tmp12775 = insertelement <4 x float> %tmp12774, float 1.000000e+00, i32 3 ; <<4 x float>> [#uses=1]
8+
store <4 x float> %tmp12775, <4 x float>* null, align 16
9+
unreachable
10+
}

0 commit comments

Comments
 (0)