summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/X86
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2014-08-15 07:41:57 +0000
committerChandler Carruth <chandlerc@gmail.com>2014-08-15 07:41:57 +0000
commit6649f532079fd1ae98585048e546369b03c9c7a2 (patch)
tree7d1188f4beb350fc9308fbc1f35bb18aa635fef3 /llvm/lib/Target/X86
parent6c53c869d0bdba55d4703588e38f60a659e959bb (diff)
downloadbcm5719-llvm-6649f532079fd1ae98585048e546369b03c9c7a2.tar.gz
bcm5719-llvm-6649f532079fd1ae98585048e546369b03c9c7a2.zip
[x86] Remove the duplicated code for testing whether we can widen the
elements of a shuffle mask and simplify how it works. No functionality changed now that the bug that was here has been fixed. llvm-svn: 215696
Diffstat (limited to 'llvm/lib/Target/X86')
-rw-r--r--llvm/lib/Target/X86/X86ISelLowering.cpp16
1 files changed, 4 insertions, 12 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index 5143f19c763..4e3e23c0988 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -19493,18 +19493,10 @@ static bool combineX86ShufflesRecursively(SDValue Op, SDValue Root,
// elements, and shrink them to the half-width mask. It does this in a loop
// so it will reduce the size of the mask to the minimal width mask which
// performs an equivalent shuffle.
- while (Mask.size() > 1) {
- SmallVector<int, 16> NewMask;
- for (int i = 0, e = Mask.size()/2; i < e; ++i) {
- if (Mask[2*i] % 2 != 0 || Mask[2*i] + 1 != Mask[2*i + 1]) {
- NewMask.clear();
- break;
- }
- NewMask.push_back(Mask[2*i] / 2);
- }
- if (NewMask.empty())
- break;
- Mask.swap(NewMask);
+ while (Mask.size() > 1 && canWidenShuffleElements(Mask)) {
+ for (int i = 0, e = Mask.size() / 2; i < e; ++i)
+ Mask[i] = Mask[2 * i] / 2;
+ Mask.resize(Mask.size() / 2);
}
return combineX86ShuffleChain(Op, Root, Mask, Depth, HasPSHUFB, DAG, DCI,
OpenPOWER on IntegriCloud