clang  16.0.0git
SemaRISCVVectorLookup.cpp
Go to the documentation of this file.
1 //==- SemaRISCVVectorLookup.cpp - Name Lookup for RISC-V Vector Intrinsic -==//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file implements name lookup for RISC-V vector intrinsic.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #include "clang/AST/ASTContext.h"
14 #include "clang/AST/Decl.h"
15 #include "clang/Basic/Builtins.h"
16 #include "clang/Basic/TargetInfo.h"
17 #include "clang/Lex/Preprocessor.h"
18 #include "clang/Sema/Lookup.h"
20 #include "clang/Sema/Sema.h"
22 #include "llvm/ADT/SmallVector.h"
23 #include <string>
24 #include <vector>
25 
26 using namespace llvm;
27 using namespace clang;
28 using namespace clang::RISCV;
29 
30 namespace {
31 
32 // Function definition of a RVV intrinsic.
33 struct RVVIntrinsicDef {
34  /// Full function name with suffix, e.g. vadd_vv_i32m1.
35  std::string Name;
36 
37  /// Overloaded function name, e.g. vadd.
38  std::string OverloadName;
39 
40  /// Mapping to which clang built-in function, e.g. __builtin_rvv_vadd.
41  std::string BuiltinName;
42 
43  /// Function signature, first element is return type.
44  RVVTypes Signature;
45 };
46 
47 struct RVVOverloadIntrinsicDef {
48  // Indexes of RISCVIntrinsicManagerImpl::IntrinsicList.
49  SmallVector<size_t, 8> Indexes;
50 };
51 
52 } // namespace
53 
55 #define DECL_SIGNATURE_TABLE
56 #include "clang/Basic/riscv_vector_builtin_sema.inc"
57 #undef DECL_SIGNATURE_TABLE
58 };
59 
61 #define DECL_INTRINSIC_RECORDS
62 #include "clang/Basic/riscv_vector_builtin_sema.inc"
63 #undef DECL_INTRINSIC_RECORDS
64 };
65 
66 // Get subsequence of signature table.
68  uint8_t Length) {
69  return makeArrayRef(&RVVSignatureTable[Index], Length);
70 }
71 
72 static QualType RVVType2Qual(ASTContext &Context, const RVVType *Type) {
73  QualType QT;
74  switch (Type->getScalarType()) {
75  case ScalarTypeKind::Void:
76  QT = Context.VoidTy;
77  break;
79  QT = Context.getSizeType();
80  break;
82  QT = Context.getPointerDiffType();
83  break;
85  QT = Context.UnsignedLongTy;
86  break;
88  QT = Context.LongTy;
89  break;
91  QT = Context.BoolTy;
92  break;
94  QT = Context.getIntTypeForBitwidth(Type->getElementBitwidth(), true);
95  break;
97  QT = Context.getIntTypeForBitwidth(Type->getElementBitwidth(), false);
98  break;
100  switch (Type->getElementBitwidth()) {
101  case 64:
102  QT = Context.DoubleTy;
103  break;
104  case 32:
105  QT = Context.FloatTy;
106  break;
107  case 16:
108  QT = Context.Float16Ty;
109  break;
110  default:
111  llvm_unreachable("Unsupported floating point width.");
112  }
113  break;
114  case Invalid:
115  llvm_unreachable("Unhandled type.");
116  }
117  if (Type->isVector())
118  QT = Context.getScalableVectorType(QT, Type->getScale().value());
119 
120  if (Type->isConstant())
121  QT = Context.getConstType(QT);
122 
123  // Transform the type to a pointer as the last step, if necessary.
124  if (Type->isPointer())
125  QT = Context.getPointerType(QT);
126 
127  return QT;
128 }
129 
130 namespace {
131 class RISCVIntrinsicManagerImpl : public sema::RISCVIntrinsicManager {
132 private:
133  Sema &S;
134  ASTContext &Context;
135  RVVTypeCache TypeCache;
136 
137  // List of all RVV intrinsic.
138  std::vector<RVVIntrinsicDef> IntrinsicList;
139  // Mapping function name to index of IntrinsicList.
140  StringMap<size_t> Intrinsics;
141  // Mapping function name to RVVOverloadIntrinsicDef.
142  StringMap<RVVOverloadIntrinsicDef> OverloadIntrinsics;
143 
144  // Create IntrinsicList
145  void InitIntrinsicList();
146 
147  // Create RVVIntrinsicDef.
148  void InitRVVIntrinsic(const RVVIntrinsicRecord &Record, StringRef SuffixStr,
149  StringRef OverloadedSuffixStr, bool IsMask,
150  RVVTypes &Types, bool HasPolicy, Policy DefaultPolicy,
151  bool IsPrototypeDefaultTU);
152 
153  // Create FunctionDecl for a vector intrinsic.
154  void CreateRVVIntrinsicDecl(LookupResult &LR, IdentifierInfo *II,
155  Preprocessor &PP, unsigned Index,
156  bool IsOverload);
157 
158 public:
159  RISCVIntrinsicManagerImpl(clang::Sema &S) : S(S), Context(S.Context) {
160  InitIntrinsicList();
161  }
162 
163  // Create RISC-V vector intrinsic and insert into symbol table if found, and
164  // return true, otherwise return false.
165  bool CreateIntrinsicIfFound(LookupResult &LR, IdentifierInfo *II,
166  Preprocessor &PP) override;
167 };
168 } // namespace
169 
170 void RISCVIntrinsicManagerImpl::InitIntrinsicList() {
171  const TargetInfo &TI = Context.getTargetInfo();
172  bool HasVectorFloat32 = TI.hasFeature("zve32f");
173  bool HasVectorFloat64 = TI.hasFeature("zve64d");
174  bool HasZvfh = TI.hasFeature("experimental-zvfh");
175  bool HasRV64 = TI.hasFeature("64bit");
176  bool HasFullMultiply = TI.hasFeature("v");
177 
178  // Construction of RVVIntrinsicRecords need to sync with createRVVIntrinsics
179  // in RISCVVEmitter.cpp.
180  for (auto &Record : RVVIntrinsicRecords) {
181  // Create Intrinsics for each type and LMUL.
182  BasicType BaseType = BasicType::Unknown;
183  ArrayRef<PrototypeDescriptor> BasicProtoSeq =
184  ProtoSeq2ArrayRef(Record.PrototypeIndex, Record.PrototypeLength);
185  ArrayRef<PrototypeDescriptor> SuffixProto =
186  ProtoSeq2ArrayRef(Record.SuffixIndex, Record.SuffixLength);
187  ArrayRef<PrototypeDescriptor> OverloadedSuffixProto = ProtoSeq2ArrayRef(
188  Record.OverloadedSuffixIndex, Record.OverloadedSuffixSize);
189 
190  PolicyScheme UnMaskedPolicyScheme =
191  static_cast<PolicyScheme>(Record.UnMaskedPolicyScheme);
192  PolicyScheme MaskedPolicyScheme =
193  static_cast<PolicyScheme>(Record.MaskedPolicyScheme);
194 
196  RVVIntrinsic::computeBuiltinTypes(
197  BasicProtoSeq, /*IsMasked=*/false,
198  /*HasMaskedOffOperand=*/false, Record.HasVL, Record.NF,
199  Record.IsPrototypeDefaultTU, UnMaskedPolicyScheme);
200 
202  RVVIntrinsic::computeBuiltinTypes(
203  BasicProtoSeq, /*IsMasked=*/true, Record.HasMaskedOffOperand,
204  Record.HasVL, Record.NF, Record.IsPrototypeDefaultTU,
205  MaskedPolicyScheme);
206 
207  bool UnMaskedHasPolicy = UnMaskedPolicyScheme != PolicyScheme::SchemeNone;
208  bool MaskedHasPolicy = MaskedPolicyScheme != PolicyScheme::SchemeNone;
209  // If unmasked builtin supports policy, they should be TU or TA.
210  llvm::SmallVector<Policy> SupportedUnMaskedPolicies = {Policy::TU,
211  Policy::TA};
212  llvm::SmallVector<Policy> SupportedMaskedPolicies =
213  RVVIntrinsic::getSupportedMaskedPolicies(Record.HasTailPolicy,
214  Record.HasMaskPolicy);
215 
216  for (unsigned int TypeRangeMaskShift = 0;
217  TypeRangeMaskShift <= static_cast<unsigned int>(BasicType::MaxOffset);
218  ++TypeRangeMaskShift) {
219  unsigned int BaseTypeI = 1 << TypeRangeMaskShift;
220  BaseType = static_cast<BasicType>(BaseTypeI);
221 
222  if ((BaseTypeI & Record.TypeRangeMask) != BaseTypeI)
223  continue;
224 
225  // Check requirement.
226  if (BaseType == BasicType::Float16 && !HasZvfh)
227  continue;
228 
229  if (BaseType == BasicType::Float32 && !HasVectorFloat32)
230  continue;
231 
232  if (BaseType == BasicType::Float64 && !HasVectorFloat64)
233  continue;
234 
235  if (((Record.RequiredExtensions & RVV_REQ_RV64) == RVV_REQ_RV64) &&
236  !HasRV64)
237  continue;
238 
239  if ((BaseType == BasicType::Int64) &&
240  ((Record.RequiredExtensions & RVV_REQ_FullMultiply) ==
242  !HasFullMultiply)
243  continue;
244 
245  // Expanded with different LMUL.
246  for (int Log2LMUL = -3; Log2LMUL <= 3; Log2LMUL++) {
247  if (!(Record.Log2LMULMask & (1 << (Log2LMUL + 3))))
248  continue;
249 
250  Optional<RVVTypes> Types =
251  TypeCache.computeTypes(BaseType, Log2LMUL, Record.NF, ProtoSeq);
252 
253  // Ignored to create new intrinsic if there are any illegal types.
254  if (!Types.has_value())
255  continue;
256 
257  std::string SuffixStr = RVVIntrinsic::getSuffixStr(
258  TypeCache, BaseType, Log2LMUL, SuffixProto);
259  std::string OverloadedSuffixStr = RVVIntrinsic::getSuffixStr(
260  TypeCache, BaseType, Log2LMUL, OverloadedSuffixProto);
261 
262  // Create non-masked intrinsic.
263  InitRVVIntrinsic(Record, SuffixStr, OverloadedSuffixStr, false, *Types,
264  UnMaskedHasPolicy, Policy::PolicyNone,
265  Record.IsPrototypeDefaultTU);
266 
267  // Create non-masked policy intrinsic.
268  if (Record.UnMaskedPolicyScheme != PolicyScheme::SchemeNone) {
269  for (auto P : SupportedUnMaskedPolicies) {
271  RVVIntrinsic::computeBuiltinTypes(
272  BasicProtoSeq, /*IsMasked=*/false,
273  /*HasMaskedOffOperand=*/false, Record.HasVL, Record.NF,
274  Record.IsPrototypeDefaultTU, UnMaskedPolicyScheme, P);
275  Optional<RVVTypes> PolicyTypes = TypeCache.computeTypes(
276  BaseType, Log2LMUL, Record.NF, PolicyPrototype);
277  InitRVVIntrinsic(Record, SuffixStr, OverloadedSuffixStr,
278  /*IsMask=*/false, *PolicyTypes, UnMaskedHasPolicy,
279  P, Record.IsPrototypeDefaultTU);
280  }
281  }
282  if (!Record.HasMasked)
283  continue;
284  // Create masked intrinsic.
285  Optional<RVVTypes> MaskTypes =
286  TypeCache.computeTypes(BaseType, Log2LMUL, Record.NF, ProtoMaskSeq);
287  InitRVVIntrinsic(Record, SuffixStr, OverloadedSuffixStr, true,
288  *MaskTypes, MaskedHasPolicy, Policy::PolicyNone,
289  Record.IsPrototypeDefaultTU);
290  if (Record.MaskedPolicyScheme == PolicyScheme::SchemeNone)
291  continue;
292  // Create masked policy intrinsic.
293  for (auto P : SupportedMaskedPolicies) {
295  RVVIntrinsic::computeBuiltinTypes(
296  BasicProtoSeq, /*IsMasked=*/true, Record.HasMaskedOffOperand,
297  Record.HasVL, Record.NF, Record.IsPrototypeDefaultTU,
298  MaskedPolicyScheme, P);
299  Optional<RVVTypes> PolicyTypes = TypeCache.computeTypes(
300  BaseType, Log2LMUL, Record.NF, PolicyPrototype);
301  InitRVVIntrinsic(Record, SuffixStr, OverloadedSuffixStr,
302  /*IsMask=*/true, *PolicyTypes, MaskedHasPolicy, P,
303  Record.IsPrototypeDefaultTU);
304  }
305  } // End for different LMUL
306  } // End for different TypeRange
307  }
308 }
309 
310 // Compute name and signatures for intrinsic with practical types.
311 void RISCVIntrinsicManagerImpl::InitRVVIntrinsic(
312  const RVVIntrinsicRecord &Record, StringRef SuffixStr,
313  StringRef OverloadedSuffixStr, bool IsMasked, RVVTypes &Signature,
314  bool HasPolicy, Policy DefaultPolicy, bool IsPrototypeDefaultTU) {
315  // Function name, e.g. vadd_vv_i32m1.
316  std::string Name = Record.Name;
317  if (!SuffixStr.empty())
318  Name += "_" + SuffixStr.str();
319 
320  // Overloaded function name, e.g. vadd.
321  std::string OverloadedName;
322  if (!Record.OverloadedName)
323  OverloadedName = StringRef(Record.Name).split("_").first.str();
324  else
325  OverloadedName = Record.OverloadedName;
326  if (!OverloadedSuffixStr.empty())
327  OverloadedName += "_" + OverloadedSuffixStr.str();
328 
329  // clang built-in function name, e.g. __builtin_rvv_vadd.
330  std::string BuiltinName = "__builtin_rvv_" + std::string(Record.Name);
331 
332  RVVIntrinsic::updateNamesAndPolicy(IsMasked, HasPolicy, IsPrototypeDefaultTU,
333  Name, BuiltinName, OverloadedName,
334  DefaultPolicy);
335 
336  // Put into IntrinsicList.
337  size_t Index = IntrinsicList.size();
338  IntrinsicList.push_back({Name, OverloadedName, BuiltinName, Signature});
339 
340  // Creating mapping to Intrinsics.
341  Intrinsics.insert({Name, Index});
342 
343  // Get the RVVOverloadIntrinsicDef.
344  RVVOverloadIntrinsicDef &OverloadIntrinsicDef =
345  OverloadIntrinsics[OverloadedName];
346 
347  // And added the index.
348  OverloadIntrinsicDef.Indexes.push_back(Index);
349 }
350 
351 void RISCVIntrinsicManagerImpl::CreateRVVIntrinsicDecl(LookupResult &LR,
352  IdentifierInfo *II,
353  Preprocessor &PP,
354  unsigned Index,
355  bool IsOverload) {
356  ASTContext &Context = S.Context;
357  RVVIntrinsicDef &IDef = IntrinsicList[Index];
358  RVVTypes Sigs = IDef.Signature;
359  size_t SigLength = Sigs.size();
360  RVVType *ReturnType = Sigs[0];
361  QualType RetType = RVVType2Qual(Context, ReturnType);
362  SmallVector<QualType, 8> ArgTypes;
363  QualType BuiltinFuncType;
364 
365  // Skip return type, and convert RVVType to QualType for arguments.
366  for (size_t i = 1; i < SigLength; ++i)
367  ArgTypes.push_back(RVVType2Qual(Context, Sigs[i]));
368 
370  Context.getDefaultCallingConvention(false, false, true));
371 
372  PI.Variadic = false;
373 
374  SourceLocation Loc = LR.getNameLoc();
375  BuiltinFuncType = Context.getFunctionType(RetType, ArgTypes, PI);
377 
378  FunctionDecl *RVVIntrinsicDecl = FunctionDecl::Create(
379  Context, Parent, Loc, Loc, II, BuiltinFuncType, /*TInfo=*/nullptr,
381  /*isInlineSpecified*/ false,
382  /*hasWrittenPrototype*/ true);
383 
384  // Create Decl objects for each parameter, adding them to the
385  // FunctionDecl.
386  const auto *FP = cast<FunctionProtoType>(BuiltinFuncType);
388  for (unsigned IParm = 0, E = FP->getNumParams(); IParm != E; ++IParm) {
389  ParmVarDecl *Parm =
390  ParmVarDecl::Create(Context, RVVIntrinsicDecl, Loc, Loc, nullptr,
391  FP->getParamType(IParm), nullptr, SC_None, nullptr);
392  Parm->setScopeInfo(0, IParm);
393  ParmList.push_back(Parm);
394  }
395  RVVIntrinsicDecl->setParams(ParmList);
396 
397  // Add function attributes.
398  if (IsOverload)
399  RVVIntrinsicDecl->addAttr(OverloadableAttr::CreateImplicit(Context));
400 
401  // Setup alias to __builtin_rvv_*
402  IdentifierInfo &IntrinsicII = PP.getIdentifierTable().get(IDef.BuiltinName);
403  RVVIntrinsicDecl->addAttr(
404  BuiltinAliasAttr::CreateImplicit(S.Context, &IntrinsicII));
405 
406  // Add to symbol table.
407  LR.addDecl(RVVIntrinsicDecl);
408 }
409 
410 bool RISCVIntrinsicManagerImpl::CreateIntrinsicIfFound(LookupResult &LR,
411  IdentifierInfo *II,
412  Preprocessor &PP) {
413  StringRef Name = II->getName();
414 
415  // Lookup the function name from the overload intrinsics first.
416  auto OvIItr = OverloadIntrinsics.find(Name);
417  if (OvIItr != OverloadIntrinsics.end()) {
418  const RVVOverloadIntrinsicDef &OvIntrinsicDef = OvIItr->second;
419  for (auto Index : OvIntrinsicDef.Indexes)
420  CreateRVVIntrinsicDecl(LR, II, PP, Index,
421  /*IsOverload*/ true);
422 
423  // If we added overloads, need to resolve the lookup result.
424  LR.resolveKind();
425  return true;
426  }
427 
428  // Lookup the function name from the intrinsics.
429  auto Itr = Intrinsics.find(Name);
430  if (Itr != Intrinsics.end()) {
431  CreateRVVIntrinsicDecl(LR, II, PP, Itr->second,
432  /*IsOverload*/ false);
433  return true;
434  }
435 
436  // It's not an RVV intrinsics.
437  return false;
438 }
439 
440 namespace clang {
441 std::unique_ptr<clang::sema::RISCVIntrinsicManager>
443  return std::make_unique<RISCVIntrinsicManagerImpl>(S);
444 }
445 } // namespace clang
Builtins.h
clang::RISCV::PrototypeDescriptor
Definition: RISCVVIntrinsicUtils.h:112
clang::RISCV::Size_t
@ Size_t
Definition: RISCVVIntrinsicUtils.h:163
llvm
YAML serialization mapping.
Definition: Dominators.h:30
clang::FPOptions::isFPConstrained
bool isFPConstrained() const
Definition: LangOptions.h:733
string
string(SUBSTRING ${CMAKE_CURRENT_BINARY_DIR} 0 ${PATH_LIB_START} PATH_HEAD) string(SUBSTRING $
Definition: CMakeLists.txt:22
clang::DeclContext
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
Definition: DeclBase.h:1389
RVVType2Qual
static QualType RVVType2Qual(ASTContext &Context, const RVVType *Type)
Definition: SemaRISCVVectorLookup.cpp:72
clang::RISCV::Boolean
@ Boolean
Definition: RISCVVIntrinsicUtils.h:167
clang::RISCV::SignedLong
@ SignedLong
Definition: RISCVVIntrinsicUtils.h:166
clang::RISCV::TU
@ TU
Definition: RISCVVIntrinsicUtils.h:97
clang::ASTContext::VoidTy
CanQualType VoidTy
Definition: ASTContext.h:1107
llvm::SmallVector
Definition: LLVM.h:38
Lookup.h
clang::IdentifierTable::get
IdentifierInfo & get(StringRef Name)
Return the identifier token info for the specified named identifier.
Definition: IdentifierTable.h:597
clang::SourceLocation
Encodes a location in the source.
Definition: SourceLocation.h:86
TargetInfo.h
clang::QualType
A (possibly-)qualified type.
Definition: Type.h:737
clang::LookupResult
Represents the results of name lookup.
Definition: Lookup.h:46
clang::ParmVarDecl
Represents a parameter to a function.
Definition: Decl.h:1712
clang::TargetInfo
Exposes information about the current target.
Definition: TargetInfo.h:205
clang::ASTContext::getFunctionType
QualType getFunctionType(QualType ResultTy, ArrayRef< QualType > Args, const FunctionProtoType::ExtProtoInfo &EPI) const
Return a normal function type with a typed argument list.
Definition: ASTContext.h:1561
clang::RISCV::PolicyScheme
PolicyScheme
Definition: RISCVVIntrinsicUtils.h:303
clang::RISCV
RISCV builtins.
Definition: TargetBuiltins.h:143
clang::RISCV::SignedInteger
@ SignedInteger
Definition: RISCVVIntrinsicUtils.h:168
clang::TargetInfo::hasFeature
virtual bool hasFeature(StringRef Feature) const
Determine whether the given target has the given feature.
Definition: TargetInfo.h:1378
llvm::Optional
Definition: LLVM.h:40
clang::ASTContext::getScalableVectorType
QualType getScalableVectorType(QualType EltTy, unsigned NumElts) const
Return the unique reference to a scalable vector type of the specified element type and scalable numb...
Definition: ASTContext.cpp:4033
RVVIntrinsicRecords
static const RVVIntrinsicRecord RVVIntrinsicRecords[]
Definition: SemaRISCVVectorLookup.cpp:60
clang::ASTContext::getTranslationUnitDecl
TranslationUnitDecl * getTranslationUnitDecl() const
Definition: ASTContext.h:1089
clang::LookupResult::getNameLoc
SourceLocation getNameLoc() const
Gets the location of the identifier.
Definition: Lookup.h:632
clang::Preprocessor::getIdentifierTable
IdentifierTable & getIdentifierTable()
Definition: Preprocessor.h:1072
clang::Sema::Context
ASTContext & Context
Definition: Sema.h:409
clang::Type
The base class of the type hierarchy.
Definition: Type.h:1565
Preprocessor.h
Decl.h
clang::LookupResult::addDecl
void addDecl(NamedDecl *D)
Add a declaration to these results with its natural access.
Definition: Lookup.h:452
clang::LookupResult::resolveKind
void resolveKind()
Resolves the result kind of the lookup, possibly hiding decls.
Definition: SemaLookup.cpp:481
clang::ParmVarDecl::setScopeInfo
void setScopeInfo(unsigned scopeDepth, unsigned parameterIndex)
Definition: Decl.h:1745
clang::prec::Unknown
@ Unknown
Definition: OperatorPrecedence.h:27
clang::RISCV::UnsignedLong
@ UnsignedLong
Definition: RISCVVIntrinsicUtils.h:165
clang::ASTContext::getDefaultCallingConvention
CallingConv getDefaultCallingConvention(bool IsVariadic, bool IsCXXMethod, bool IsBuiltin=false) const
Retrieves the default calling convention for the current target.
Definition: ASTContext.cpp:11828
clang::ASTContext::Float16Ty
CanQualType Float16Ty
Definition: ASTContext.h:1133
clang::RISCV::Ptrdiff_t
@ Ptrdiff_t
Definition: RISCVVIntrinsicUtils.h:164
clang::SC_Extern
@ SC_Extern
Definition: Specifiers.h:239
clang::ASTContext
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition: ASTContext.h:209
clang::ASTContext::getSizeType
CanQualType getSizeType() const
Return the unique type for "size_t" (C99 7.17), defined in <stddef.h>.
Definition: ASTContext.cpp:5933
clang::RISCV::RVV_REQ_FullMultiply
@ RVV_REQ_FullMultiply
Definition: RISCVVIntrinsicUtils.h:412
clang::CreateRISCVIntrinsicManager
std::unique_ptr< sema::RISCVIntrinsicManager > CreateRISCVIntrinsicManager(Sema &S)
Definition: SemaRISCVVectorLookup.cpp:442
clang::RISCV::Policy
Policy
Definition: RISCVVIntrinsicUtils.h:96
clang::RISCV::PolicyNone
@ PolicyNone
Definition: RISCVVIntrinsicUtils.h:107
clang::RISCV::SchemeNone
@ SchemeNone
Definition: RISCVVIntrinsicUtils.h:304
clang::RISCV::RVVType
Definition: RISCVVIntrinsicUtils.h:190
ASTContext.h
clang::ASTContext::getIntTypeForBitwidth
QualType getIntTypeForBitwidth(unsigned DestWidth, unsigned Signed) const
getIntTypeForBitwidth - sets integer QualTy according to specified details: bitwidth,...
Definition: ASTContext.cpp:11958
clang::ASTContext::FloatTy
CanQualType FloatTy
Definition: ASTContext.h:1119
RISCVVIntrinsicUtils.h
clang::Sema::getCurFPFeatures
FPOptions & getCurFPFeatures()
Definition: Sema.h:1632
RVVSignatureTable
static const PrototypeDescriptor RVVSignatureTable[]
Definition: SemaRISCVVectorLookup.cpp:54
Sema.h
clang::ASTContext::UnsignedLongTy
CanQualType UnsignedLongTy
Definition: ASTContext.h:1117
clang::ASTContext::getConstType
QualType getConstType(QualType T) const
Return the uniqued reference to the type for a const qualified type.
Definition: ASTContext.h:1303
clang::RISCV::RVVIntrinsicRecord
Definition: RISCVVIntrinsicUtils.h:419
clang::RISCV::TA
@ TA
Definition: RISCVVIntrinsicUtils.h:98
P
StringRef P
Definition: ASTMatchersInternal.cpp:563
clang::sema::RISCVIntrinsicManager
Definition: RISCVIntrinsicManager.h:23
clang::RISCV::RVV_REQ_RV64
@ RVV_REQ_RV64
Definition: RISCVVIntrinsicUtils.h:411
clang::ASTContext::DoubleTy
CanQualType DoubleTy
Definition: ASTContext.h:1119
clang::RISCV::RVVTypes
std::vector< RVVTypePtr > RVVTypes
Definition: RISCVVIntrinsicUtils.h:186
llvm::ArrayRef
Definition: LLVM.h:34
clang::ASTContext::LongTy
CanQualType LongTy
Definition: ASTContext.h:1116
clang::RISCV::Float
@ Float
Definition: RISCVVIntrinsicUtils.h:170
clang::Sema
Sema - This implements semantic analysis and AST building for C.
Definition: Sema.h:358
ProtoSeq2ArrayRef
static ArrayRef< PrototypeDescriptor > ProtoSeq2ArrayRef(uint16_t Index, uint8_t Length)
Definition: SemaRISCVVectorLookup.cpp:67
clang::RISCV::RVVIntrinsicRecord::Name
const char * Name
Definition: RISCVVIntrinsicUtils.h:421
clang::IdentifierInfo
One of these records is kept for each identifier that is lexed.
Definition: IdentifierTable.h:85
clang::RISCV::UnsignedInteger
@ UnsignedInteger
Definition: RISCVVIntrinsicUtils.h:169
clang::ASTContext::getTargetInfo
const TargetInfo & getTargetInfo() const
Definition: ASTContext.h:773
RISCVIntrinsicManager.h
clang::RISCV::RVVTypeCache
Definition: RISCVVIntrinsicUtils.h:286
clang::IdentifierInfo::getName
StringRef getName() const
Return the actual identifier string.
Definition: IdentifierTable.h:196
clang::FunctionProtoType::ExtProtoInfo
Extra information about a function prototype.
Definition: Type.h:4099
clang
Definition: CalledOnceCheck.h:17
clang::ASTContext::getPointerDiffType
QualType getPointerDiffType() const
Return the unique type for "ptrdiff_t" (C99 7.17) defined in <stddef.h>.
Definition: ASTContext.cpp:5977
clang::ASTContext::getPointerType
QualType getPointerType(QualType T) const
Return the uniqued reference to the type for a pointer to the specified type.
Definition: ASTContext.cpp:3341
Parent
NodeId Parent
Definition: ASTDiff.cpp:190
clang::RISCV::BasicType
BasicType
Definition: RISCVVIntrinsicUtils.h:147
clang::SC_None
@ SC_None
Definition: Specifiers.h:238
clang::Preprocessor
Engages in a tight little dance with the lexer to efficiently preprocess tokens.
Definition: Preprocessor.h:129
clang::Decl::addAttr
void addAttr(Attr *A)
Definition: DeclBase.cpp:902
clang::ASTContext::BoolTy
CanQualType BoolTy
Definition: ASTContext.h:1108
clang::RISCV::Invalid
@ Invalid
Definition: RISCVVIntrinsicUtils.h:171
clang::FunctionDecl
Represents a function declaration or definition.
Definition: Decl.h:1904
clang::RISCV::RVVIntrinsicRecord::OverloadedName
const char * OverloadedName
Definition: RISCVVIntrinsicUtils.h:425