28 if (MangledName.
empty())
126 Ret = tryParseLinearTokenWithRuntimeStep(ParseString, PKind, StepOrPos,
"ls");
131 Ret = tryParseLinearTokenWithRuntimeStep(ParseString, PKind, StepOrPos,
"Rs");
136 Ret = tryParseLinearTokenWithRuntimeStep(ParseString, PKind, StepOrPos,
"Ls");
141 Ret = tryParseLinearTokenWithRuntimeStep(ParseString, PKind, StepOrPos,
"Us");
188 if (tryParseCompileTimeLinearToken(ParseString, PKind, StepOrPos,
"l") ==
193 if (tryParseCompileTimeLinearToken(ParseString, PKind, StepOrPos,
"R") ==
198 if (tryParseCompileTimeLinearToken(ParseString, PKind, StepOrPos,
"L") ==
203 if (tryParseCompileTimeLinearToken(ParseString, PKind, StepOrPos,
"U") ==
221 const char *UniformToken =
"u";
249 tryParseLinearWithRuntimeStep(ParseString, PKind, StepOrPos);
251 return HasLinearRuntime;
253 const ParseRet HasLinearCompileTime =
254 tryParseLinearWithCompileTimeStep(ParseString, PKind, StepOrPos);
256 return HasLinearCompileTime;
258 const ParseRet HasUniform = tryParseUniform(ParseString, PKind, StepOrPos);
283 Alignment =
Align(Val);
295 const StringRef OriginalName = MangledName;
308 if (tryParseISA(MangledName, ISA) != ParseRet::OK)
313 if (tryParseMask(MangledName, IsMasked) != ParseRet::OK)
319 if (tryParseVLEN(MangledName, VF, IsScalable) != ParseRet::OK)
326 const unsigned ParameterPos = Parameters.
size();
329 ParamFound = tryParseParameter(MangledName, PKind, StepOrPos);
335 if (ParamFound == ParseRet::OK) {
338 const ParseRet AlignFound = tryParseAlign(MangledName, Alignment);
344 Parameters.
push_back({ParameterPos, PKind, StepOrPos, Alignment});
346 }
while (ParamFound == ParseRet::OK);
350 if (Parameters.
empty())
361 MangledName.
take_while([](
char In) {
return In !=
'('; });
363 if (ScalarName.
empty())
367 MangledName = MangledName.
ltrim(ScalarName);
373 VectorName = MangledName;
375 if (VectorName.
empty())
387 const unsigned Pos = Parameters.
size();
400 assert(NGlobalPreds < 2 &&
"Cannot have more than one global predicate.");
403 "The global predicate must be the last parameter");
405 const VFShape Shape({VF, IsScalable, Parameters});
406 return VFInfo({Shape, ScalarName, VectorName, ISA});
428 " that have a textual representation in the mangled name" 429 " of the Vector Function ABI");
LLVM_NODISCARD StringRef take_front(size_t N=1) const
Return a StringRef equal to 'this' but with only the first N elements remaining.
constexpr char Align[]
Key for Kernel::Arg::Metadata::mAlign.
This class represents lattice values for constants.
static bool IsMasked(Instruction *I)
LLVM_NODISCARD bool startswith(StringRef Prefix) const
Check if this string starts with the given Prefix.
void push_back(const T &Elt)
bool consume_front(StringRef Prefix)
Returns true if this StringRef has the given prefix and removes that prefix.
auto count_if(R &&Range, UnaryPredicate P) -> typename std::iterator_traits< decltype(adl_begin(Range))>::difference_type
Wrapper function around std::count_if to count the number of times an element satisfying a given pred...
Contains the information about the kind of vectorization available.
LLVM_NODISCARD StringRef ltrim(char Char) const
Return string with consecutive Char characters starting from the the left removed.
static constexpr char const * _LLVM_
LLVM Internal VFABI ISA token for vector functions.
Holds the VFShape for a specific scalar to vector function mapping.
StringSwitch & Case(StringLiteral S, T Value)
LLVM_NODISCARD StringRef drop_front(size_t N=1) const
Return a StringRef equal to 'this' but with the first N elements dropped.
LLVM_NODISCARD R Default(T Value)
LLVM_NODISCARD bool empty() const
empty - Check if the string is empty.
LLVM_NODISCARD StringRef take_while(function_ref< bool(char)> F) const
Return the longest prefix of 'this' such that every character in the prefix satisfies the given predi...
std::enable_if< std::numeric_limits< T >::is_signed, bool >::type consumeInteger(unsigned Radix, T &Result)
Parse the current string as an integer of the specified radix.
VFISAKind
Describes the type of Instruction Set Architecture.
A switch()-like statement whose cases are string literals.
Encapsulates information needed to describe a parameter.
constexpr bool isPowerOf2_64(uint64_t Value)
Return true if the argument is a power of two > 0 (64 bit edition.)
Optional< VFInfo > tryDemangleForVFABI(StringRef MangledName)
Function to contruct a VFInfo out of a mangled names in the following format:
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
This struct is a compact representation of a valid (non-zero power of two) alignment.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
VFParamKind
Describes the type of Parameters.
LLVM_NODISCARD bool empty() const
ParseRet
Utilities for the Vector Function ABI name parser.
bool consume_back(StringRef Suffix)
Returns true if this StringRef has the given suffix and removes that suffix.
VFParamKind getVFParamKindFromString(const StringRef Token)
Retrieve the VFParamKind from a string token.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Lightweight error class with error context and mandatory checking.
StringRef - Represent a constant reference to a string, i.e.