Skip to content

Commit 430729d

Browse files
[NFC][LLVM] Clean up TLI VECFUNC macros. (#93178)
Move the undef'ing of library specific macros to the places in the code base where they are defined.
1 parent c455ab7 commit 430729d

File tree

3 files changed

+13
-17
lines changed

3 files changed

+13
-17
lines changed

llvm/include/llvm/Analysis/VecFuncs.def

-16
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@
1212
// This .def file also allows creating an array of vector functions supported in
1313
// the specified framework or library.
1414

15-
#if defined(TLI_DEFINE_MASSV_VECFUNCS_NAMES)
16-
#define TLI_DEFINE_MASSV_VECFUNCS
17-
#define TLI_DEFINE_VECFUNC(SCAL, VEC, VF, VABI_PREFIX) VEC,
18-
#endif
19-
2015
#define FIXED(NL) ElementCount::getFixed(NL)
2116
#define SCALABLE(NL) ElementCount::getScalable(NL)
2217
#define NOMASK false
@@ -1276,14 +1271,3 @@ TLI_DEFINE_VECFUNC("cbrtf", "amd_vrs4_cbrtf", FIXED(4), NOMASK, "_ZGV_LLVM_N4v")
12761271
#undef FIXED
12771272

12781273
#undef TLI_DEFINE_VECFUNC
1279-
#undef TLI_DEFINE_ACCELERATE_VECFUNCS
1280-
#undef TLI_DEFINE_DARWIN_LIBSYSTEM_M_VECFUNCS
1281-
#undef TLI_DEFINE_LIBMVEC_X86_VECFUNCS
1282-
#undef TLI_DEFINE_MASSV_VECFUNCS
1283-
#undef TLI_DEFINE_SVML_VECFUNCS
1284-
#undef TLI_DEFINE_SLEEFGNUABI_VF2_VECFUNCS
1285-
#undef TLI_DEFINE_SLEEFGNUABI_VF4_VECFUNCS
1286-
#undef TLI_DEFINE_SLEEFGNUABI_SCALABLE_VECFUNCS
1287-
#undef TLI_DEFINE_MASSV_VECFUNCS_NAMES
1288-
#undef TLI_DEFINE_ARMPL_VECFUNCS
1289-
#undef TLI_DEFINE_AMDLIBM_VECFUNCS

llvm/lib/Analysis/TargetLibraryInfo.cpp

+10
Original file line numberDiff line numberDiff line change
@@ -1204,59 +1204,69 @@ void TargetLibraryInfoImpl::addVectorizableFunctions(ArrayRef<VecDesc> Fns) {
12041204
static const VecDesc VecFuncs_Accelerate[] = {
12051205
#define TLI_DEFINE_ACCELERATE_VECFUNCS
12061206
#include "llvm/Analysis/VecFuncs.def"
1207+
#undef TLI_DEFINE_ACCELERATE_VECFUNCS
12071208
};
12081209

12091210
static const VecDesc VecFuncs_DarwinLibSystemM[] = {
12101211
#define TLI_DEFINE_DARWIN_LIBSYSTEM_M_VECFUNCS
12111212
#include "llvm/Analysis/VecFuncs.def"
1213+
#undef TLI_DEFINE_DARWIN_LIBSYSTEM_M_VECFUNCS
12121214
};
12131215

12141216
static const VecDesc VecFuncs_LIBMVEC_X86[] = {
12151217
#define TLI_DEFINE_LIBMVEC_X86_VECFUNCS
12161218
#include "llvm/Analysis/VecFuncs.def"
1219+
#undef TLI_DEFINE_LIBMVEC_X86_VECFUNCS
12171220
};
12181221

12191222
static const VecDesc VecFuncs_MASSV[] = {
12201223
#define TLI_DEFINE_MASSV_VECFUNCS
12211224
#include "llvm/Analysis/VecFuncs.def"
1225+
#undef TLI_DEFINE_MASSV_VECFUNCS
12221226
};
12231227

12241228
static const VecDesc VecFuncs_SVML[] = {
12251229
#define TLI_DEFINE_SVML_VECFUNCS
12261230
#include "llvm/Analysis/VecFuncs.def"
1231+
#undef TLI_DEFINE_SVML_VECFUNCS
12271232
};
12281233

12291234
static const VecDesc VecFuncs_SLEEFGNUABI_VF2[] = {
12301235
#define TLI_DEFINE_SLEEFGNUABI_VF2_VECFUNCS
12311236
#define TLI_DEFINE_VECFUNC(SCAL, VEC, VF, VABI_PREFIX) \
12321237
{SCAL, VEC, VF, /* MASK = */ false, VABI_PREFIX},
12331238
#include "llvm/Analysis/VecFuncs.def"
1239+
#undef TLI_DEFINE_SLEEFGNUABI_VF2_VECFUNCS
12341240
};
12351241
static const VecDesc VecFuncs_SLEEFGNUABI_VF4[] = {
12361242
#define TLI_DEFINE_SLEEFGNUABI_VF4_VECFUNCS
12371243
#define TLI_DEFINE_VECFUNC(SCAL, VEC, VF, VABI_PREFIX) \
12381244
{SCAL, VEC, VF, /* MASK = */ false, VABI_PREFIX},
12391245
#include "llvm/Analysis/VecFuncs.def"
1246+
#undef TLI_DEFINE_SLEEFGNUABI_VF4_VECFUNCS
12401247
};
12411248
static const VecDesc VecFuncs_SLEEFGNUABI_VFScalable[] = {
12421249
#define TLI_DEFINE_SLEEFGNUABI_SCALABLE_VECFUNCS
12431250
#define TLI_DEFINE_VECFUNC(SCAL, VEC, VF, MASK, VABI_PREFIX) \
12441251
{SCAL, VEC, VF, MASK, VABI_PREFIX},
12451252
#include "llvm/Analysis/VecFuncs.def"
1253+
#undef TLI_DEFINE_SLEEFGNUABI_SCALABLE_VECFUNCS
12461254
};
12471255

12481256
static const VecDesc VecFuncs_ArmPL[] = {
12491257
#define TLI_DEFINE_ARMPL_VECFUNCS
12501258
#define TLI_DEFINE_VECFUNC(SCAL, VEC, VF, MASK, VABI_PREFIX) \
12511259
{SCAL, VEC, VF, MASK, VABI_PREFIX},
12521260
#include "llvm/Analysis/VecFuncs.def"
1261+
#undef TLI_DEFINE_ARMPL_VECFUNCS
12531262
};
12541263

12551264
const VecDesc VecFuncs_AMDLIBM[] = {
12561265
#define TLI_DEFINE_AMDLIBM_VECFUNCS
12571266
#define TLI_DEFINE_VECFUNC(SCAL, VEC, VF, MASK, VABI_PREFIX) \
12581267
{SCAL, VEC, VF, MASK, VABI_PREFIX},
12591268
#include "llvm/Analysis/VecFuncs.def"
1269+
#undef TLI_DEFINE_AMDLIBM_VECFUNCS
12601270
};
12611271

12621272
void TargetLibraryInfoImpl::addVectorizableFunctionsFromVecLib(

llvm/lib/Target/PowerPC/PPCLowerMASSVEntries.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,10 @@ using namespace llvm;
2929
namespace {
3030

3131
static StringRef MASSVFuncs[] = {
32-
#define TLI_DEFINE_MASSV_VECFUNCS_NAMES
32+
#define TLI_DEFINE_MASSV_VECFUNCS
33+
#define TLI_DEFINE_VECFUNC(SCAL, VEC, VF, VABI_PREFIX) VEC,
3334
#include "llvm/Analysis/VecFuncs.def"
35+
#undef TLI_DEFINE_MASSV_VECFUNCS
3436
};
3537

3638
class PPCLowerMASSVEntries : public ModulePass {

0 commit comments

Comments
 (0)