diff options
| author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2016-05-07 18:04:24 +0000 | 
|---|---|---|
| committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2016-05-07 18:04:24 +0000 | 
| commit | 96e5307d4e3eb1a7caf644a3a55ef57a174167da (patch) | |
| tree | 0253a4ec221e05e8bf669bbe94376f8aeb4c73dd /llvm | |
| parent | b06c012243eee03eefa3b420da49bb34caa63b32 (diff) | |
| download | bcm5719-llvm-96e5307d4e3eb1a7caf644a3a55ef57a174167da.tar.gz bcm5719-llvm-96e5307d4e3eb1a7caf644a3a55ef57a174167da.zip  | |
[X86] Pulled out duplicate mask width calculation. NFCI.
llvm-svn: 268861
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/lib/Target/X86/X86ISelLowering.cpp | 5 | 
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index 53a1800a2b9..dc20ab02e69 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -24326,6 +24326,7 @@ static bool combineX86ShufflesRecursively(SDValue Op, SDValue Root,             OpMask.size() % RootMask.size() == 0) ||            OpMask.size() == RootMask.size()) &&           "The smaller number of elements must divide the larger."); +  int MaskWidth = std::max<int>(OpMask.size(), RootMask.size());    int RootRatio = std::max<int>(1, OpMask.size() / RootMask.size());    int OpRatio = std::max<int>(1, RootMask.size() / OpMask.size());    assert(((RootRatio == 1 && OpRatio == 1) || @@ -24333,13 +24334,13 @@ static bool combineX86ShufflesRecursively(SDValue Op, SDValue Root,           "Must not have a ratio for both incoming and op masks!");    SmallVector<int, 16> Mask; -  Mask.reserve(std::max(OpMask.size(), RootMask.size())); +  Mask.reserve(MaskWidth);    // Merge this shuffle operation's mask into our accumulated mask. Note that    // this shuffle's mask will be the first applied to the input, followed by the    // root mask to get us all the way to the root value arrangement. The reason    // for this order is that we are recursing up the operation chain. -  for (int i = 0, e = std::max(OpMask.size(), RootMask.size()); i < e; ++i) { +  for (int i = 0; i < MaskWidth; ++i) {      int RootIdx = i / RootRatio;      if (RootMask[RootIdx] < 0) {        // This is a zero or undef lane, we're done.  | 

