Skip to content

Commit d419001

Browse files
committed
Corrected the TLI macros to only contain the mangled name prefix
and adjusted the implementation.
1 parent b7d3c9c commit d419001

File tree

6 files changed

+725
-691
lines changed

6 files changed

+725
-691
lines changed

llvm/include/llvm/Analysis/TargetLibraryInfo.h

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ class Function;
2424
class Module;
2525
class Triple;
2626

27-
/// Describes a possible vectorization of a function.
28-
/// Function 'VectorFnName' is equivalent to 'ScalarFnName' vectorized
29-
/// by a factor 'VectorizationFactor'.
30-
/// The MangledName string holds scalar-to-vector mapping:
27+
/// Provides info so a possible vectorization of a function can be
28+
/// computed. Function 'VectorFnName' is equivalent to 'ScalarFnName'
29+
/// vectorized by a factor 'VectorizationFactor'.
30+
/// The MangledNamePrefix string holds information about isa, mask, vlen,
31+
/// and vparams so a scalar-to-vector mapping of the form:
3132
/// _ZGV<isa><mask><vlen><vparams>_<scalarname>(<vectorname>)
32-
///
33-
/// where:
33+
/// can be constructed where:
3434
///
3535
/// <isa> = "_LLVM_"
3636
/// <mask> = "M" if masked, "N" if no mask.
@@ -41,26 +41,26 @@ class Triple;
4141
/// <scalarname> = the name of the scalar function.
4242
/// <vectorname> = the name of the vector function.
4343
class VecDesc {
44-
private:
4544
StringRef ScalarFnName;
4645
StringRef VectorFnName;
4746
ElementCount VectorizationFactor;
4847
bool Masked;
49-
StringRef MangledName;
48+
StringRef MangledNamePrefix;
5049

5150
public:
5251
VecDesc() = delete;
5352
VecDesc(StringRef ScalarFnName, StringRef VectorFnName,
54-
ElementCount VectorizationFactor, bool Masked, StringRef MangledName)
53+
ElementCount VectorizationFactor, bool Masked,
54+
StringRef MangledNamePrefix)
5555
: ScalarFnName(ScalarFnName), VectorFnName(VectorFnName),
5656
VectorizationFactor(VectorizationFactor), Masked(Masked),
57-
MangledName(MangledName) {}
57+
MangledNamePrefix(MangledNamePrefix) {}
5858

5959
StringRef getScalarFnName() const { return ScalarFnName; }
6060
StringRef getVectorFnName() const { return VectorFnName; }
6161
ElementCount getVectorizationFactor() const { return VectorizationFactor; }
62-
bool getMasked() const { return Masked; }
63-
StringRef getMangledName() const { return MangledName; }
62+
bool isMasked() const { return Masked; }
63+
StringRef getMangledNamePrefix() const { return MangledNamePrefix; }
6464
};
6565

6666
enum LibFunc : unsigned {
@@ -200,16 +200,16 @@ class TargetLibraryInfoImpl {
200200
/// vectorization factor.
201201
bool isFunctionVectorizable(StringRef F) const;
202202

203-
/// Return the name of the equivalent of F, vectorized with factor VF.
204-
/// If no such mapping exists, return empty strings.
203+
/// Return the name of the equivalent of F, vectorized with factor VF. If no
204+
/// such mapping exists, return the empty string.
205205
StringRef getVectorizedFunction(StringRef F, const ElementCount &VF,
206206
bool Masked) const;
207207

208208
/// Return a pointer to a VecDesc object holding all info for scalar to vector
209209
/// mappings in TLI for the equivalent of F, vectorized with factor VF.
210210
/// If no such mapping exists, return nullpointer.
211-
const VecDesc *getMangledTLIVectorName(StringRef F, const ElementCount &VF,
212-
bool Masked) const;
211+
const VecDesc *getVectorMappingInfo(StringRef F, const ElementCount &VF,
212+
bool Masked) const;
213213

214214
/// Set to true iff i32 parameters to library functions should have signext
215215
/// or zeroext attributes if they correspond to C-level int or unsigned int,
@@ -389,9 +389,9 @@ class TargetLibraryInfo {
389389
bool Masked = false) const {
390390
return Impl->getVectorizedFunction(F, VF, Masked);
391391
}
392-
const VecDesc *getMangledTLIVectorName(StringRef F, const ElementCount &VF,
393-
bool Masked) const {
394-
return Impl->getMangledTLIVectorName(F, VF, Masked);
392+
const VecDesc *getVectorMappingInfo(StringRef F, const ElementCount &VF,
393+
bool Masked) const {
394+
return Impl->getVectorMappingInfo(F, VF, Masked);
395395
}
396396

397397
/// Tests if the function is both available and a candidate for optimized code

0 commit comments

Comments
 (0)