@@ -163,13 +163,17 @@ static bool Is16bitsType(MVT VT) {
163
163
VT.SimpleTy == MVT::i16 );
164
164
}
165
165
166
- // When legalizing vector loads/stores, this function is called, which does two things:
167
- // 1. Determines Whether the vector is something we want to custom lower, std::nullopt is returned if we do not want to custom lower it.
166
+ // When legalizing vector loads/stores, this function is called, which does two
167
+ // things:
168
+ // 1. Determines Whether the vector is something we want to custom lower,
169
+ // std::nullopt is returned if we do not want to custom lower it.
168
170
// 2. If we do want to handle it, returns three parameters:
169
171
// - unsigned int NumElts - The number of elements in the final vector
170
172
// - EVT EltVT - The type of the elements in the final vector
171
- // - bool UpsizeElementTypes - Whether or not we are upsizing the elements of the vectors
172
- static std::optional<std::tuple<unsigned int , EVT, bool >> tryGetVectorLoweringParams (EVT ValVT) {
173
+ // - bool UpsizeElementTypes - Whether or not we are upsizing the elements of
174
+ // the vector
175
+ static std::optional<std::tuple<unsigned int , EVT, bool >>
176
+ tryGetVectorLoweringParams (EVT ValVT) {
173
177
// Despite vectors like v8i8, v16i8, v8i16 being within the bit-limit for
174
178
// total load/store size, PTX syntax only supports v2/v4. Thus, we can't use
175
179
// vectorized loads/stores with the actual element type for i8/i16 as that
@@ -2885,8 +2889,7 @@ NVPTXTargetLowering::LowerSTOREVector(SDValue Op, SelectionDAG &DAG) const {
2885
2889
const DataLayout &TD = DAG.getDataLayout ();
2886
2890
2887
2891
Align Alignment = MemSD->getAlign ();
2888
- Align PrefAlign =
2889
- TD.getPrefTypeAlign (ValVT.getTypeForEVT (*DAG.getContext ()));
2892
+ Align PrefAlign = TD.getPrefTypeAlign (ValVT.getTypeForEVT (*DAG.getContext ()));
2890
2893
if (Alignment < PrefAlign) {
2891
2894
// This store is not sufficiently aligned, so bail out and let this vector
2892
2895
// store be scalarized. Note that we may still be able to emit smaller
@@ -2935,7 +2938,7 @@ NVPTXTargetLowering::LowerSTOREVector(SDValue Op, SelectionDAG &DAG) const {
2935
2938
} else {
2936
2939
for (unsigned i = 0 ; i < NumElts; ++i) {
2937
2940
SDValue ExtVal = DAG.getNode (ISD::EXTRACT_VECTOR_ELT, DL, EltVT, Val,
2938
- DAG.getIntPtrConstant (i, DL));
2941
+ DAG.getIntPtrConstant (i, DL));
2939
2942
if (NeedExt)
2940
2943
ExtVal = DAG.getNode (ISD::ANY_EXTEND, DL, MVT::i16 , ExtVal);
2941
2944
Ops.push_back (ExtVal);
0 commit comments