diff options
author | Vincent Lejeune <vljn@ovi.com> | 2013-10-13 17:56:04 +0000 |
---|---|---|
committer | Vincent Lejeune <vljn@ovi.com> | 2013-10-13 17:56:04 +0000 |
commit | 91ec4b0cac7a7476a9d30d6f1adbf218ee6673a0 (patch) | |
tree | 8fc4ed97c4ac62ed0d7732a4974961c901893d24 /lib/Target | |
parent | 6639f066e1cec93f10acfacf21d3a57c41a00bc7 (diff) | |
download | external_llvm-91ec4b0cac7a7476a9d30d6f1adbf218ee6673a0.zip external_llvm-91ec4b0cac7a7476a9d30d6f1adbf218ee6673a0.tar.gz external_llvm-91ec4b0cac7a7476a9d30d6f1adbf218ee6673a0.tar.bz2 |
R600: fix swizzle export
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192553 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target')
-rw-r--r-- | lib/Target/R600/R600ISelLowering.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/Target/R600/R600ISelLowering.cpp b/lib/Target/R600/R600ISelLowering.cpp index 62577ea..81a28be 100644 --- a/lib/Target/R600/R600ISelLowering.cpp +++ b/lib/Target/R600/R600ISelLowering.cpp @@ -1422,12 +1422,16 @@ static SDValue ReorganizeVector(SelectionDAG &DAG, SDValue VectorEntry, if (NewBldVec[i].getOpcode() == ISD::EXTRACT_VECTOR_ELT) { unsigned Idx = dyn_cast<ConstantSDNode>(NewBldVec[i].getOperand(1)) ->getZExtValue(); - if (!isUnmovable[Idx]) { - // Swap i and Idx - std::swap(NewBldVec[Idx], NewBldVec[i]); - std::swap(RemapSwizzle[RemapSwizzle[Idx]], RemapSwizzle[RemapSwizzle[i]]); + if (i == Idx) { + isUnmovable[Idx] = true; + continue; } - isUnmovable[Idx] = true; + if (isUnmovable[Idx]) + continue; + // Swap i and Idx + std::swap(NewBldVec[Idx], NewBldVec[i]); + std::swap(RemapSwizzle[i], RemapSwizzle[Idx]); + break; } } |