From 0387df7f02f9a0a0239b5a90f840e98b823bc6c1 Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Tue, 12 May 2020 13:43:38 +0100 Subject: [PATCH] [X86] combineX86ShuffleChain - use narrowShuffleMaskElts scale == 1 builtin handling. NFC. narrowShuffleMaskElts already has the fast-path for scale == 1, no need to reimplement it here. --- llvm/lib/Target/X86/X86ISelLowering.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index 42723a0..7b8a62c 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -34128,14 +34128,10 @@ static SDValue combineX86ShuffleChain(ArrayRef Inputs, SDValue Root, return DAG.getBitcast(RootVT, Res); } + // Narrow shuffle mask to v4x128. SmallVector Mask; - if (BaseMaskEltSizeInBits > 128) { - assert((BaseMaskEltSizeInBits % 128) == 0 && "Illegal mask size"); - int MaskScale = BaseMaskEltSizeInBits / 128; - narrowShuffleMaskElts(MaskScale, BaseMask, Mask); - } else { - Mask.assign(BaseMask.begin(), BaseMask.end()); - } + assert((BaseMaskEltSizeInBits % 128) == 0 && "Illegal mask size"); + narrowShuffleMaskElts(BaseMaskEltSizeInBits / 128, BaseMask, Mask); // Try to lower to vshuf64x2/vshuf32x4. auto MatchSHUF128 = [](MVT ShuffleVT, const SDLoc &DL, ArrayRef Mask, -- 2.7.4