[llvm-commits] [llvm] r136450 - /llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
Bruno Cardoso Lopes
bruno.cardoso at gmail.com
Thu Jul 28 18:31:04 PDT 2011
Author: bruno
Date: Thu Jul 28 20:31:04 2011
New Revision: 136450
URL: http://llvm.org/viewvc/llvm-project?rev=136450&view=rev
Log:
Fix a bug while generating target specific VPERMIL masks: skip
undef mask elements. This fixes PR10529.
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=136450&r1=136449&r2=136450&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Thu Jul 28 20:31:04 2011
@@ -3488,8 +3488,12 @@
int NumLanes = VT.getSizeInBits()/128;
unsigned Mask = 0;
- for (int i = 0; i < NumElts/NumLanes /* lane size */; ++i)
- Mask |= SVOp->getMaskElt(i) << (i*2);
+ for (int i = 0; i < NumElts/NumLanes /* lane size */; ++i) {
+ int MaskElt = SVOp->getMaskElt(i);
+ if (MaskElt < 0)
+ continue;
+ Mask |= MaskElt << (i*2);
+ }
return Mask;
}
@@ -3506,8 +3510,12 @@
unsigned Mask = 0;
int LaneSize = NumElts/NumLanes;
for (int l = 0; l < NumLanes; ++l)
- for (int i = l*LaneSize; i < LaneSize*(l+1); ++i)
- Mask |= (SVOp->getMaskElt(i)-l*LaneSize) << i;
+ for (int i = l*LaneSize; i < LaneSize*(l+1); ++i) {
+ int MaskElt = SVOp->getMaskElt(i);
+ if (MaskElt < 0)
+ continue;
+ Mask |= (MaskElt-l*LaneSize) << i;
+ }
return Mask;
}
More information about the llvm-commits
mailing list