[PATCH] D126634: [RISCV][NFC] Rename variables in rvv intrinsics related files.

2022-05-31 Thread Zakk Chen via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG79e3d57f5228: [RISCV][NFC] Rename variables in rvv 
intrinsics related files. (authored by khchen).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D126634/new/

https://reviews.llvm.org/D126634

Files:
  clang/include/clang/Basic/riscv_vector.td
  clang/include/clang/Support/RISCVVIntrinsicUtils.h
  clang/lib/Support/RISCVVIntrinsicUtils.cpp
  clang/utils/TableGen/RISCVVEmitter.cpp

Index: clang/utils/TableGen/RISCVVEmitter.cpp
===
--- clang/utils/TableGen/RISCVVEmitter.cpp
+++ clang/utils/TableGen/RISCVVEmitter.cpp
@@ -155,10 +155,10 @@
   OS << ");\n";
 }
 
-void emitMangledFuncDef(const RVVIntrinsic &RVVI, raw_ostream &OS) {
+void emitOverloadedFuncDef(const RVVIntrinsic &RVVI, raw_ostream &OS) {
   OS << "__attribute__((__clang_builtin_alias__(";
   OS << "__builtin_rvv_" << RVVI.getBuiltinName() << ")))\n";
-  OS << RVVI.getOutputType()->getTypeStr() << " " << RVVI.getMangledName()
+  OS << RVVI.getOutputType()->getTypeStr() << " " << RVVI.getOverloadedName()
  << "(";
   // Emit function arguments
   const RVVTypes &InputTypes = RVVI.getInputTypes();
@@ -289,7 +289,7 @@
 if (!Inst.isMasked() && !Inst.hasUnMaskedOverloaded())
   return;
 OS << "__rvv_aio ";
-emitMangledFuncDef(Inst, OS);
+emitOverloadedFuncDef(Inst, OS);
   });
 
   OS << "#undef __rvv_aio\n";
@@ -387,8 +387,8 @@
   for (auto *R : RV) {
 StringRef Name = R->getValueAsString("Name");
 StringRef SuffixProto = R->getValueAsString("Suffix");
-StringRef OverloadedName = R->getValueAsString("MangledName");
-StringRef OverloadedSuffixProto = R->getValueAsString("MangledSuffix");
+StringRef OverloadedName = R->getValueAsString("OverloadedName");
+StringRef OverloadedSuffixProto = R->getValueAsString("OverloadedSuffix");
 StringRef Prototypes = R->getValueAsString("Prototype");
 StringRef TypeRange = R->getValueAsString("TypeRange");
 bool HasMasked = R->getValueAsBit("HasMasked");
Index: clang/lib/Support/RISCVVIntrinsicUtils.cpp
===
--- clang/lib/Support/RISCVVIntrinsicUtils.cpp
+++ clang/lib/Support/RISCVVIntrinsicUtils.cpp
@@ -791,13 +791,13 @@
 
 Optional
 RVVType::computeTypes(BasicType BT, int Log2LMUL, unsigned NF,
-  ArrayRef PrototypeSeq) {
+  ArrayRef Prototype) {
   // LMUL x NF must be less than or equal to 8.
   if ((Log2LMUL >= 1) && (1 << Log2LMUL) * NF > 8)
 return llvm::None;
 
   RVVTypes Types;
-  for (const PrototypeDescriptor &Proto : PrototypeSeq) {
+  for (const PrototypeDescriptor &Proto : Prototype) {
 auto T = computeType(BT, Log2LMUL, Proto);
 if (!T.hasValue())
   return llvm::None;
@@ -847,8 +847,8 @@
 // RVVIntrinsic implementation
 //===--===//
 RVVIntrinsic::RVVIntrinsic(
-StringRef NewName, StringRef Suffix, StringRef NewMangledName,
-StringRef MangledSuffix, StringRef IRName, bool IsMasked,
+StringRef NewName, StringRef Suffix, StringRef NewOverloadedName,
+StringRef OverloadedSuffix, StringRef IRName, bool IsMasked,
 bool HasMaskedOffOperand, bool HasVL, PolicyScheme Scheme,
 bool HasUnMaskedOverloaded, bool HasBuiltinAlias, StringRef ManualCodegen,
 const RVVTypes &OutInTypes, const std::vector &NewIntrinsicTypes,
@@ -858,17 +858,17 @@
   HasBuiltinAlias(HasBuiltinAlias), ManualCodegen(ManualCodegen.str()),
   NF(NF) {
 
-  // Init BuiltinName, Name and MangledName
+  // Init BuiltinName, Name and OverloadedName
   BuiltinName = NewName.str();
   Name = BuiltinName;
-  if (NewMangledName.empty())
-MangledName = NewName.split("_").first.str();
+  if (NewOverloadedName.empty())
+OverloadedName = NewName.split("_").first.str();
   else
-MangledName = NewMangledName.str();
+OverloadedName = NewOverloadedName.str();
   if (!Suffix.empty())
 Name += "_" + Suffix.str();
-  if (!MangledSuffix.empty())
-MangledName += "_" + MangledSuffix.str();
+  if (!OverloadedSuffix.empty())
+OverloadedName += "_" + OverloadedSuffix.str();
   if (IsMasked) {
 BuiltinName += "_m";
 Name += "_m";
Index: clang/include/clang/Support/RISCVVIntrinsicUtils.h
===
--- clang/include/clang/Support/RISCVVIntrinsicUtils.h
+++ clang/include/clang/Support/RISCVVIntrinsicUtils.h
@@ -256,7 +256,7 @@
   /// have illegal RVVType.
   static llvm::Optional
   computeTypes(BasicType BT, int Log2LMUL, unsigned NF,
-   llvm::ArrayRef PrototypeSeq);
+   llvm::ArrayRef Prototype);
   static llvm::Optional computeType(BasicType BT, int Log2LMUL,
 PrototypeDescriptor Proto);
 };
@@ -287,7 +287,7 @@
 private:
  

[PATCH] D126634: [RISCV][NFC] Rename variables in rvv intrinsics related files.

2022-05-30 Thread Yeting Kuo via Phabricator via cfe-commits
fakepaper56 added a comment.

LGTM.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D126634/new/

https://reviews.llvm.org/D126634

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D126634: [RISCV][NFC] Rename variables in rvv intrinsics related files.

2022-05-30 Thread Zakk Chen via Phabricator via cfe-commits
khchen created this revision.
khchen added a reviewer: kito-cheng.
Herald added subscribers: sunshaoce, VincentWu, luke957, vkmr, frasercrmck, 
evandro, luismarques, apazos, sameer.abuasal, s.egerton, Jim, benna, psnobl, 
jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, 
zzheng, jrtc27, shiva0217, niosHD, sabuasal, simoncook, johnrusso, rbar, asb, 
arichardson.
Herald added a project: All.
khchen requested review of this revision.
Herald added subscribers: cfe-commits, pcwang-thead, eopXD, MaskRay.
Herald added a project: clang.

This patch does the same thing as D125886  
did.

- Use `Overloaded` rather than `Mangled`.
- Use `Prototype` or `Desc` rather than `Seq`, it's not just a string

sequence.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D126634

Files:
  clang/include/clang/Basic/riscv_vector.td
  clang/include/clang/Support/RISCVVIntrinsicUtils.h
  clang/lib/Support/RISCVVIntrinsicUtils.cpp
  clang/utils/TableGen/RISCVVEmitter.cpp

Index: clang/utils/TableGen/RISCVVEmitter.cpp
===
--- clang/utils/TableGen/RISCVVEmitter.cpp
+++ clang/utils/TableGen/RISCVVEmitter.cpp
@@ -155,10 +155,10 @@
   OS << ");\n";
 }
 
-void emitMangledFuncDef(const RVVIntrinsic &RVVI, raw_ostream &OS) {
+void emitOverloadedFuncDef(const RVVIntrinsic &RVVI, raw_ostream &OS) {
   OS << "__attribute__((__clang_builtin_alias__(";
   OS << "__builtin_rvv_" << RVVI.getBuiltinName() << ")))\n";
-  OS << RVVI.getOutputType()->getTypeStr() << " " << RVVI.getMangledName()
+  OS << RVVI.getOutputType()->getTypeStr() << " " << RVVI.getOverloadedName()
  << "(";
   // Emit function arguments
   const RVVTypes &InputTypes = RVVI.getInputTypes();
@@ -289,7 +289,7 @@
 if (!Inst.isMasked() && !Inst.hasUnMaskedOverloaded())
   return;
 OS << "__rvv_aio ";
-emitMangledFuncDef(Inst, OS);
+emitOverloadedFuncDef(Inst, OS);
   });
 
   OS << "#undef __rvv_aio\n";
@@ -387,8 +387,8 @@
   for (auto *R : RV) {
 StringRef Name = R->getValueAsString("Name");
 StringRef SuffixProto = R->getValueAsString("Suffix");
-StringRef OverloadedName = R->getValueAsString("MangledName");
-StringRef OverloadedSuffixProto = R->getValueAsString("MangledSuffix");
+StringRef OverloadedName = R->getValueAsString("OverloadedName");
+StringRef OverloadedSuffixProto = R->getValueAsString("OverloadedSuffix");
 StringRef Prototypes = R->getValueAsString("Prototype");
 StringRef TypeRange = R->getValueAsString("TypeRange");
 bool HasMasked = R->getValueAsBit("HasMasked");
Index: clang/lib/Support/RISCVVIntrinsicUtils.cpp
===
--- clang/lib/Support/RISCVVIntrinsicUtils.cpp
+++ clang/lib/Support/RISCVVIntrinsicUtils.cpp
@@ -791,13 +791,13 @@
 
 Optional
 RVVType::computeTypes(BasicType BT, int Log2LMUL, unsigned NF,
-  ArrayRef PrototypeSeq) {
+  ArrayRef Prototype) {
   // LMUL x NF must be less than or equal to 8.
   if ((Log2LMUL >= 1) && (1 << Log2LMUL) * NF > 8)
 return llvm::None;
 
   RVVTypes Types;
-  for (const PrototypeDescriptor &Proto : PrototypeSeq) {
+  for (const PrototypeDescriptor &Proto : Prototype) {
 auto T = computeType(BT, Log2LMUL, Proto);
 if (!T.hasValue())
   return llvm::None;
@@ -847,8 +847,8 @@
 // RVVIntrinsic implementation
 //===--===//
 RVVIntrinsic::RVVIntrinsic(
-StringRef NewName, StringRef Suffix, StringRef NewMangledName,
-StringRef MangledSuffix, StringRef IRName, bool IsMasked,
+StringRef NewName, StringRef Suffix, StringRef NewOverloadedName,
+StringRef OverloadedSuffix, StringRef IRName, bool IsMasked,
 bool HasMaskedOffOperand, bool HasVL, PolicyScheme Scheme,
 bool HasUnMaskedOverloaded, bool HasBuiltinAlias, StringRef ManualCodegen,
 const RVVTypes &OutInTypes, const std::vector &NewIntrinsicTypes,
@@ -858,17 +858,17 @@
   HasBuiltinAlias(HasBuiltinAlias), ManualCodegen(ManualCodegen.str()),
   NF(NF) {
 
-  // Init BuiltinName, Name and MangledName
+  // Init BuiltinName, Name and OverloadedName
   BuiltinName = NewName.str();
   Name = BuiltinName;
-  if (NewMangledName.empty())
-MangledName = NewName.split("_").first.str();
+  if (NewOverloadedName.empty())
+OverloadedName = NewName.split("_").first.str();
   else
-MangledName = NewMangledName.str();
+OverloadedName = NewOverloadedName.str();
   if (!Suffix.empty())
 Name += "_" + Suffix.str();
-  if (!MangledSuffix.empty())
-MangledName += "_" + MangledSuffix.str();
+  if (!OverloadedSuffix.empty())
+OverloadedName += "_" + OverloadedSuffix.str();
   if (IsMasked) {
 BuiltinName += "_m";
 Name += "_m";
Index: clang/include/clang/Support/RISCVVIntrinsicUtils.h
===