From a4d55a2c3607c411a16a01a61bd667a03fee7264 Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Wed, 23 Oct 2019 07:33:29 -0700 Subject: [PATCH] [X86] combineX86ShufflesRecursively - assert the root mask is legal. NFCI. --- llvm/lib/Target/X86/X86ISelLowering.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index ed975e9..9e62858 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -33026,6 +33026,9 @@ static SDValue combineX86ShufflesRecursively( ArrayRef RootMask, ArrayRef SrcNodes, unsigned Depth, bool HasVariableMask, bool AllowVariableMask, SelectionDAG &DAG, const X86Subtarget &Subtarget) { + assert(RootMask.size() > 0 && (RootMask.size() > 1 || RootMask[0] == 0) && + "Illegal shuffle root mask"); + // Bound the depth of our recursive combine because this is ultimately // quadratic in nature. const unsigned MaxRecursionDepth = 8; -- 2.7.4