diff options
author | Vincent Lejeune <vljn@ovi.com> | 2013-12-10 14:43:31 +0000 |
---|---|---|
committer | Vincent Lejeune <vljn@ovi.com> | 2013-12-10 14:43:31 +0000 |
commit | a563c918406b361c84031dc98465d3088159f778 (patch) | |
tree | 837dda61d9c604014cca3024d64a75b7de94d5a5 /lib/Target/R600/R600ISelLowering.cpp | |
parent | 8ff689b443251f2aad807b0d1ac6caf99465b81f (diff) | |
download | llvm-a563c918406b361c84031dc98465d3088159f778.tar.gz llvm-a563c918406b361c84031dc98465d3088159f778.tar.bz2 llvm-a563c918406b361c84031dc98465d3088159f778.tar.xz |
R600: Fix an infinite loop when trying to reorganize export/tex vector input
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196923 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/R600/R600ISelLowering.cpp')
-rw-r--r-- | lib/Target/R600/R600ISelLowering.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/Target/R600/R600ISelLowering.cpp b/lib/Target/R600/R600ISelLowering.cpp index 1155c2a760..21a2b0dd17 100644 --- a/lib/Target/R600/R600ISelLowering.cpp +++ b/lib/Target/R600/R600ISelLowering.cpp @@ -1442,17 +1442,20 @@ static SDValue ReorganizeVector(SelectionDAG &DAG, SDValue VectorEntry, VectorEntry.getOperand(3) }; bool isUnmovable[4] = { false, false, false, false }; - for (unsigned i = 0; i < 4; i++) + for (unsigned i = 0; i < 4; i++) { RemapSwizzle[i] = i; + if (NewBldVec[i].getOpcode() == ISD::EXTRACT_VECTOR_ELT) { + unsigned Idx = dyn_cast<ConstantSDNode>(NewBldVec[i].getOperand(1)) + ->getZExtValue(); + if (i == Idx) + isUnmovable[Idx] = true; + } + } for (unsigned i = 0; i < 4; i++) { if (NewBldVec[i].getOpcode() == ISD::EXTRACT_VECTOR_ELT) { unsigned Idx = dyn_cast<ConstantSDNode>(NewBldVec[i].getOperand(1)) ->getZExtValue(); - if (i == Idx) { - isUnmovable[Idx] = true; - continue; - } if (isUnmovable[Idx]) continue; // Swap i and Idx |