[llvm] r369751 - Use VT::getHalfNumVectorElementsVT helpers in a few places. NFCI.
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 23 05:37:10 PDT 2019
Author: rksimon
Date: Fri Aug 23 05:37:09 2019
New Revision: 369751
URL: http://llvm.org/viewvc/llvm-project?rev=369751&view=rev
Log:
Use VT::getHalfNumVectorElementsVT helpers in a few places. NFCI.
Modified:
llvm/trunk/lib/Target/AArch64/AArch64ISelLowering.cpp
llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
Modified: llvm/trunk/lib/Target/AArch64/AArch64ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64ISelLowering.cpp?rev=369751&r1=369750&r2=369751&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AArch64/AArch64ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/AArch64/AArch64ISelLowering.cpp Fri Aug 23 05:37:09 2019
@@ -6541,8 +6541,7 @@ static SDValue tryFormConcatFromShuffle(
if (!isConcatMask(Mask, VT, SplitV0))
return SDValue();
- EVT CastVT = EVT::getVectorVT(*DAG.getContext(), VT.getVectorElementType(),
- VT.getVectorNumElements() / 2);
+ EVT CastVT = VT.getHalfNumVectorElementsVT(*DAG.getContext());
if (SplitV0) {
V0 = DAG.getNode(ISD::EXTRACT_SUBVECTOR, DL, CastVT, V0,
DAG.getConstant(0, DL, MVT::i64));
@@ -10610,10 +10609,10 @@ static SDValue splitStores(SDNode *N, Ta
return ReplacedSplat;
SDLoc DL(S);
- unsigned NumElts = VT.getVectorNumElements() / 2;
+
// Split VT into two.
- EVT HalfVT =
- EVT::getVectorVT(*DAG.getContext(), VT.getVectorElementType(), NumElts);
+ EVT HalfVT = VT.getHalfNumVectorElementsVT(*DAG.getContext());
+ unsigned NumElts = HalfVT.getVectorNumElements();
SDValue SubVector0 = DAG.getNode(ISD::EXTRACT_SUBVECTOR, DL, HalfVT, StVal,
DAG.getConstant(0, DL, MVT::i64));
SDValue SubVector1 = DAG.getNode(ISD::EXTRACT_SUBVECTOR, DL, HalfVT, StVal,
Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=369751&r1=369750&r2=369751&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Fri Aug 23 05:37:09 2019
@@ -26543,8 +26543,7 @@ static SDValue LowerBITCAST(SDValue Op,
SDLoc dl(Op);
SDValue Lo, Hi;
std::tie(Lo, Hi) = DAG.SplitVector(Op.getOperand(0), dl);
- EVT CastVT = MVT::getVectorVT(DstVT.getVectorElementType(),
- DstVT.getVectorNumElements() / 2);
+ MVT CastVT = DstVT.getHalfNumVectorElementsVT();
Lo = DAG.getBitcast(CastVT, Lo);
Hi = DAG.getBitcast(CastVT, Hi);
return DAG.getNode(ISD::CONCAT_VECTORS, dl, DstVT, Lo, Hi);
@@ -27845,9 +27844,7 @@ void X86TargetLowering::ReplaceNodeResul
// since sign_extend_inreg i8/i16->i64 requires an extend to i32 using
// sra. Then extending from i32 to i64 using pcmpgt. By custom splitting
// we allow the sra from the extend to i32 to be shared by the split.
- EVT ExtractVT = EVT::getVectorVT(*DAG.getContext(),
- InVT.getVectorElementType(),
- InVT.getVectorNumElements() / 2);
+ EVT ExtractVT = InVT.getHalfNumVectorElementsVT(*DAG.getContext());
MVT ExtendVT = MVT::getVectorVT(MVT::i32,
VT.getVectorNumElements());
In = DAG.getNode(ISD::EXTRACT_SUBVECTOR, dl, ExtractVT,
More information about the llvm-commits
mailing list