[llvm] r309261 - [X86] Tidyup MaskedLoad/Store mask creation. NFCI.
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 27 03:29:04 PDT 2017
Author: rksimon
Date: Thu Jul 27 03:29:04 2017
New Revision: 309261
URL: http://llvm.org/viewvc/llvm-project?rev=309261&view=rev
Log:
[X86] Tidyup MaskedLoad/Store mask creation. NFCI.
Assign all concat elements to zero and then just replace the first element, instead of setting them all to null and copying everything in.
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=309261&r1=309260&r2=309261&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Thu Jul 27 03:29:04 2017
@@ -32967,6 +32967,7 @@ static SDValue combineMaskedLoad(SDNode
WideSrc0 = DAG.getVectorShuffle(WideVecVT, dl, WideSrc0,
DAG.getUNDEF(WideVecVT), ShuffleVec);
}
+
// Prepare the new mask.
SDValue NewMask;
SDValue Mask = Mld->getMask();
@@ -32989,12 +32990,9 @@ static SDValue combineMaskedLoad(SDNode
WidenNumElts);
unsigned NumConcat = WidenNumElts / MaskNumElts;
- SmallVector<SDValue, 16> Ops(NumConcat);
SDValue ZeroVal = DAG.getConstant(0, dl, Mask.getValueType());
+ SmallVector<SDValue, 16> Ops(NumConcat, ZeroVal);
Ops[0] = Mask;
- for (unsigned i = 1; i != NumConcat; ++i)
- Ops[i] = ZeroVal;
-
NewMask = DAG.getNode(ISD::CONCAT_VECTORS, dl, NewMaskVT, Ops);
}
@@ -33112,12 +33110,9 @@ static SDValue combineMaskedStore(SDNode
WidenNumElts);
unsigned NumConcat = WidenNumElts / MaskNumElts;
- SmallVector<SDValue, 16> Ops(NumConcat);
SDValue ZeroVal = DAG.getConstant(0, dl, Mask.getValueType());
+ SmallVector<SDValue, 16> Ops(NumConcat, ZeroVal);
Ops[0] = Mask;
- for (unsigned i = 1; i != NumConcat; ++i)
- Ops[i] = ZeroVal;
-
NewMask = DAG.getNode(ISD::CONCAT_VECTORS, dl, NewMaskVT, Ops);
}
More information about the llvm-commits
mailing list