Changeset View
Changeset View
Standalone View
Standalone View
llvm/lib/Target/PowerPC/PPCISelLowering.cpp
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
Show First 20 Lines • Show All 14,879 Lines • ▼ Show 20 Lines | SDValue PPCTargetLowering::combineVectorShuffle(ShuffleVectorSDNode *SVN, | ||||
// Adjust the shuffle mask if either input vector comes from a | // Adjust the shuffle mask if either input vector comes from a | ||||
// SCALAR_TO_VECTOR and keep the respective input vector in permuted | // SCALAR_TO_VECTOR and keep the respective input vector in permuted | ||||
// form (to prevent the need for a swap). | // form (to prevent the need for a swap). | ||||
SmallVector<int, 16> ShuffV(Mask.begin(), Mask.end()); | SmallVector<int, 16> ShuffV(Mask.begin(), Mask.end()); | ||||
SDValue SToVLHS = isScalarToVec(LHS); | SDValue SToVLHS = isScalarToVec(LHS); | ||||
SDValue SToVRHS = isScalarToVec(RHS); | SDValue SToVRHS = isScalarToVec(RHS); | ||||
if (SToVLHS || SToVRHS) { | if (SToVLHS || SToVRHS) { | ||||
// FIXME: If both LHS and RHS are SCALAR_TO_VECTOR, but are not the | |||||
// same type and have differing element sizes, then do not perform | |||||
// the following transformation. The current transformation for | |||||
// SCALAR_TO_VECTOR assumes that both input vectors have the same | |||||
// element size. This will be updated in the future to account for | |||||
// differing sizes of the LHS and RHS. | |||||
if (SToVLHS && SToVRHS && | |||||
(SToVLHS.getValueType().getScalarSizeInBits() != | |||||
SToVRHS.getValueType().getScalarSizeInBits())) | |||||
return Res; | |||||
int NumEltsIn = SToVLHS ? SToVLHS.getValueType().getVectorNumElements() | int NumEltsIn = SToVLHS ? SToVLHS.getValueType().getVectorNumElements() | ||||
: SToVRHS.getValueType().getVectorNumElements(); | : SToVRHS.getValueType().getVectorNumElements(); | ||||
int NumEltsOut = ShuffV.size(); | int NumEltsOut = ShuffV.size(); | ||||
// The width of the "valid lane" (i.e. the lane that contains the value that | // The width of the "valid lane" (i.e. the lane that contains the value that | ||||
// is vectorized) needs to be expressed in terms of the number of elements | // is vectorized) needs to be expressed in terms of the number of elements | ||||
// of the shuffle. It is thereby the ratio of the values before and after | // of the shuffle. It is thereby the ratio of the values before and after | ||||
// any bitcast. | // any bitcast. | ||||
unsigned ValidLaneWidth = | unsigned ValidLaneWidth = | ||||
▲ Show 20 Lines • Show All 3,283 Lines • Show Last 20 Lines |