@@ -100,16 +100,6 @@ static cl::opt<bool> ForceMinByValParamAlign(
100
100
" params of device functions." ),
101
101
cl::init(false ));
102
102
103
- static auto GetUpsizedNumEltsAndEltVT = [](unsigned OldNumElts, EVT OldEltVT) {
104
- // Number of elements to pack in one word.
105
- unsigned NPerWord = 32 / OldEltVT.getSizeInBits ();
106
- // Word-sized vector.
107
- EVT NewEltVT = MVT::getVectorVT (OldEltVT.getSimpleVT (), NPerWord);
108
- // Number of word-sized vectors.
109
- unsigned NewNumElts = OldNumElts / NPerWord;
110
- return std::pair (NewNumElts, NewEltVT);
111
- };
112
-
113
103
int NVPTXTargetLowering::getDivF32Level () const {
114
104
if (UsePrecDivF32.getNumOccurrences () > 0 ) {
115
105
// If nvptx-prec-div32=N is used on the command-line, always honor it
@@ -172,6 +162,16 @@ static bool Is16bitsType(MVT VT) {
172
162
VT.SimpleTy == MVT::i16 );
173
163
}
174
164
165
+ static auto GetUpsizedNumEltsAndEltVT (unsigned OldNumElts, EVT OldEltVT) {
166
+ // Number of elements to pack in one word.
167
+ unsigned NPerWord = 32 / OldEltVT.getSizeInBits ();
168
+ // Word-sized vector.
169
+ EVT NewEltVT = MVT::getVectorVT (OldEltVT.getSimpleVT (), NPerWord);
170
+ // Number of word-sized vectors.
171
+ unsigned NewNumElts = OldNumElts / NPerWord;
172
+ return std::pair (NewNumElts, NewEltVT);
173
+ };
174
+
175
175
// / ComputePTXValueVTs - For the given Type \p Ty, returns the set of primitive
176
176
// / EVTs that compose it. Unlike ComputeValueVTs, this will break apart vectors
177
177
// / into their primitive components.
@@ -2883,9 +2883,7 @@ NVPTXTargetLowering::LowerSTOREVector(SDValue Op, SelectionDAG &DAG) const {
2883
2883
unsigned NumElts = ValVT.getVectorNumElements ();
2884
2884
2885
2885
if (UpsizeElementTypes) {
2886
- auto [NewNumElts, NewEltVT] = GetUpsizedNumEltsAndEltVT (NumElts, EltVT);
2887
- NumElts = NewNumElts;
2888
- EltVT = NewEltVT;
2886
+ std::tie (NumElts, EltVT) = GetUpsizedNumEltsAndEltVT (NumElts, EltVT);
2889
2887
}
2890
2888
2891
2889
// Since StoreV2 is a target node, we cannot rely on DAG type legalization.
@@ -5287,9 +5285,7 @@ static void ReplaceLoadVector(SDNode *N, SelectionDAG &DAG,
5287
5285
unsigned NumElts = ResVT.getVectorNumElements ();
5288
5286
5289
5287
if (UpsizeElementTypes) {
5290
- auto [NewNumElts, NewEltVT] = GetUpsizedNumEltsAndEltVT (NumElts, EltVT);
5291
- NumElts = NewNumElts;
5292
- EltVT = NewEltVT;
5288
+ std::tie (NumElts, EltVT) = GetUpsizedNumEltsAndEltVT (NumElts, EltVT);
5293
5289
}
5294
5290
5295
5291
// Since LoadV2 is a target node, we cannot rely on DAG type legalization.
0 commit comments