[llvm] r366066 - [X86] isTargetShuffleEquivalent - assert the expected mask is correctly formed. NFCI.
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 15 07:29:14 PDT 2019
Author: rksimon
Date: Mon Jul 15 07:29:14 2019
New Revision: 366066
URL: http://llvm.org/viewvc/llvm-project?rev=366066&view=rev
Log:
[X86] isTargetShuffleEquivalent - assert the expected mask is correctly formed. NFCI.
While we don't make any assumptions about the actual mask, assert that the expected mask only contains valid mask element values.
Modified:
llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=366066&r1=366065&r2=366066&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Mon Jul 15 07:29:14 2019
@@ -10001,6 +10001,8 @@ static bool isTargetShuffleEquivalent(Ar
int Size = Mask.size();
if (Size != (int)ExpectedMask.size())
return false;
+ assert(isUndefOrZeroOrInRange(ExpectedMask, 0, 2 * Size) &&
+ "Illegal target shuffle mask");
for (int i = 0; i < Size; ++i)
if (Mask[i] == SM_SentinelUndef)
More information about the llvm-commits
mailing list