@@ -180,7 +180,10 @@ VFParamKind getVFParamKindFromString(const StringRef Token);
180
180
static constexpr char const *MappingsAttrName = " vector-function-abi-variant" ;
181
181
182
182
// / Populates a set of strings representing the Vector Function ABI variants
183
- // / associated to the CallInst CI.
183
+ // / associated to the CallInst CI. If the CI does not contain the
184
+ // / vector-function-abi-variant attribute, we return without populating
185
+ // / VariantMappings, i.e. callers of getVectorVariantNames need not check for
186
+ // / the presence of the attribute (see InjectTLIMappings).
184
187
void getVectorVariantNames (const CallInst &CI,
185
188
SmallVectorImpl<std::string> &VariantMappings);
186
189
} // end namespace VFABI
@@ -203,14 +206,13 @@ class VFDatabase {
203
206
static void getVFABIMappings (const CallInst &CI,
204
207
SmallVectorImpl<VFInfo> &Mappings) {
205
208
const StringRef ScalarName = CI.getCalledFunction ()->getName ();
206
- const StringRef S =
207
- CI.getAttribute (AttributeList::FunctionIndex, VFABI::MappingsAttrName)
208
- .getValueAsString ();
209
- if (S.empty ())
210
- return ;
211
209
212
210
SmallVector<std::string, 8 > ListOfStrings;
211
+ // The check for the vector-function-abi-variant attribute is done when
212
+ // retrieving the vector variant names here.
213
213
VFABI::getVectorVariantNames (CI, ListOfStrings);
214
+ if (ListOfStrings.empty ())
215
+ return ;
214
216
for (const auto &MangledName : ListOfStrings) {
215
217
const Optional<VFInfo> Shape =
216
218
VFABI::tryDemangleForVFABI (MangledName, *(CI.getModule ()));
0 commit comments