OSDN Git Service

[Hexagon] Don't use garbage mask in HvxSelector::shuffp2
authorKrzysztof Parzyszek <kparzysz@codeaurora.org>
Mon, 5 Feb 2018 15:46:41 +0000 (15:46 +0000)
committerKrzysztof Parzyszek <kparzysz@codeaurora.org>
Mon, 5 Feb 2018 15:46:41 +0000 (15:46 +0000)
The function shuffp2 was breaking up a wide shuffle into a pair of
narrower ones, except that the narrower shuffle masks were actually
uninitialized.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324243 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/Hexagon/HexagonISelDAGToDAGHVX.cpp

index 85340e4..8566aa6 100644 (file)
@@ -1271,6 +1271,8 @@ OpRef HvxSelector::shuffp2(ShuffleMask SM, OpRef Va, OpRef Vb,
     return shuffp1(ShuffleMask(PackedMask), P, Results);
 
   SmallVector<int,256> MaskL(VecLen), MaskR(VecLen);
+  splitMask(SM.Mask, MaskL, MaskR);
+
   OpRef L = shuffp1(ShuffleMask(MaskL), Va, Results);
   OpRef R = shuffp1(ShuffleMask(MaskR), Vb, Results);
   if (!L.isValid() || !R.isValid())