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<RVVTypes> RVVType::computeTypes(BasicType BT, int Log2LMUL, unsigned NF, - ArrayRef<PrototypeDescriptor> PrototypeSeq) { + ArrayRef<PrototypeDescriptor> 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<int64_t> &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<RVVTypes> computeTypes(BasicType BT, int Log2LMUL, unsigned NF, - llvm::ArrayRef<PrototypeDescriptor> PrototypeSeq); + llvm::ArrayRef<PrototypeDescriptor> Prototype); static llvm::Optional<RVVTypePtr> computeType(BasicType BT, int Log2LMUL, PrototypeDescriptor Proto); }; @@ -287,7 +287,7 @@ private: std::string BuiltinName; // Builtin name std::string Name; // C intrinsic name. - std::string MangledName; + std::string OverloadedName; std::string IRName; bool IsMasked; bool HasVL; @@ -304,20 +304,22 @@ unsigned NF = 1; public: - RVVIntrinsic(llvm::StringRef Name, llvm::StringRef Suffix, llvm::StringRef MangledName, - llvm::StringRef MangledSuffix, llvm::StringRef IRName, bool IsMasked, - bool HasMaskedOffOperand, bool HasVL, PolicyScheme Scheme, - bool HasUnMaskedOverloaded, bool HasBuiltinAlias, - llvm::StringRef ManualCodegen, const RVVTypes &Types, + RVVIntrinsic(llvm::StringRef Name, llvm::StringRef Suffix, + llvm::StringRef OverloadedName, llvm::StringRef OverloadedSuffix, + llvm::StringRef IRName, bool IsMasked, bool HasMaskedOffOperand, + bool HasVL, PolicyScheme Scheme, bool HasUnMaskedOverloaded, + bool HasBuiltinAlias, llvm::StringRef ManualCodegen, + const RVVTypes &Types, const std::vector<int64_t> &IntrinsicTypes, - const std::vector<llvm::StringRef> &RequiredFeatures, unsigned NF); + const std::vector<llvm::StringRef> &RequiredFeatures, + unsigned NF); ~RVVIntrinsic() = default; RVVTypePtr getOutputType() const { return OutputType; } const RVVTypes &getInputTypes() const { return InputTypes; } llvm::StringRef getBuiltinName() const { return BuiltinName; } llvm::StringRef getName() const { return Name; } - llvm::StringRef getMangledName() const { return MangledName; } + llvm::StringRef getOverloadedName() const { return OverloadedName; } bool hasVL() const { return HasVL; } bool hasPolicy() const { return Scheme != SchemeNone; } bool hasPassthruOperand() const { return Scheme == HasPassthruOperand; } Index: clang/include/clang/Basic/riscv_vector.td =================================================================== --- clang/include/clang/Basic/riscv_vector.td +++ clang/include/clang/Basic/riscv_vector.td @@ -139,7 +139,7 @@ def HasPolicyOperand : Policy<2>; class RVVBuiltin<string suffix, string prototype, string type_range, - string mangled_suffix = ""> { + string overloaded_suffix = ""> { // Base name that will be prepended in __builtin_rvv_ and appended the // computed Suffix. string Name = NAME; @@ -148,14 +148,14 @@ // underscore (_). It is instantiated like Prototype. string Suffix = suffix; - // If empty, default MangledName is sub string of `Name` which end of first - // '_'. For example, the default mangled name is `vadd` for Name `vadd_vv`. + // If empty, default OverloadedName is sub string of `Name` which end of first + // '_'. For example, the default overloaded name is `vadd` for Name `vadd_vv`. // It's used for describe some special naming cases. - string MangledName = ""; + string OverloadedName = ""; - // If not empty, each MangledName will have this appended after an + // If not empty, each OverloadedName will have this appended after an // underscore (_). It is instantiated like Prototype. - string MangledSuffix = mangled_suffix; + string OverloadedSuffix = overloaded_suffix; // The different variants of the builtin, parameterised with a type. string TypeRange = type_range; @@ -378,7 +378,7 @@ : RVVBuiltin<suffix, prototype, type_range> { let IRName = intrinsic_name; let MaskedIRName = intrinsic_name # "_mask"; - let MangledName = NAME; + let OverloadedName = NAME; let IntrinsicTypes = [-1, 0]; } @@ -462,29 +462,29 @@ class RVVFloatingUnaryVVBuiltin : RVVFloatingUnaryBuiltin<"v", "v", "vv">; class RVVConvBuiltin<string suffix, string prototype, string type_range, - string mangled_name> + string overloaded_name> : RVVBuiltin<suffix, prototype, type_range> { let IntrinsicTypes = [-1, 0]; - let MangledName = mangled_name; + let OverloadedName = overloaded_name; } -class RVVConvToSignedBuiltin<string mangled_name> - : RVVConvBuiltin<"Iv", "Ivv", "xfd", mangled_name>; +class RVVConvToSignedBuiltin<string overloaded_name> + : RVVConvBuiltin<"Iv", "Ivv", "xfd", overloaded_name>; -class RVVConvToUnsignedBuiltin<string mangled_name> - : RVVConvBuiltin<"Uv", "Uvv", "xfd", mangled_name>; +class RVVConvToUnsignedBuiltin<string overloaded_name> + : RVVConvBuiltin<"Uv", "Uvv", "xfd", overloaded_name>; -class RVVConvToWidenSignedBuiltin<string mangled_name> - : RVVConvBuiltin<"Iw", "Iwv", "xf", mangled_name>; +class RVVConvToWidenSignedBuiltin<string overloaded_name> + : RVVConvBuiltin<"Iw", "Iwv", "xf", overloaded_name>; -class RVVConvToWidenUnsignedBuiltin<string mangled_name> - : RVVConvBuiltin<"Uw", "Uwv", "xf", mangled_name>; +class RVVConvToWidenUnsignedBuiltin<string overloaded_name> + : RVVConvBuiltin<"Uw", "Uwv", "xf", overloaded_name>; -class RVVConvToNarrowingSignedBuiltin<string mangled_name> - : RVVConvBuiltin<"Iv", "IvFw", "csi", mangled_name>; +class RVVConvToNarrowingSignedBuiltin<string overloaded_name> + : RVVConvBuiltin<"Iv", "IvFw", "csi", overloaded_name>; -class RVVConvToNarrowingUnsignedBuiltin<string mangled_name> - : RVVConvBuiltin<"Uv", "UvFw", "csi", mangled_name>; +class RVVConvToNarrowingUnsignedBuiltin<string overloaded_name> + : RVVConvBuiltin<"Uv", "UvFw", "csi", overloaded_name>; let HasMaskedOffOperand = false in { multiclass RVVSignedReductionBuiltin { @@ -516,7 +516,7 @@ IRName = intrinsic_name, MaskedIRName = intrinsic_name # "_mask" in { foreach s_p = suffixes_prototypes in { let Name = NAME # "_" # s_p[0], - MangledName = NAME # "_" # s_p[0] in { + OverloadedName = NAME # "_" # s_p[0] in { defvar suffix = s_p[1]; defvar prototype = s_p[2]; def : RVVOutOp0Op1Builtin<suffix, prototype, type_range>; @@ -532,7 +532,7 @@ IRName = intrinsic_name, MaskedIRName = intrinsic_name # "_mask" in { foreach s_p = suffixes_prototypes in { let Name = NAME # "_" # s_p[0], - MangledName = NAME # "_" # s_p[0] in { + OverloadedName = NAME # "_" # s_p[0] in { defvar suffix = s_p[1]; defvar prototype = s_p[2]; def : RVVOutOp1Builtin<suffix, prototype, type_range>; @@ -1424,7 +1424,7 @@ multiclass RVVPseudoVWCVTBuiltin<string IR, string MName, string type_range, list<list<string>> suffixes_prototypes> { let Name = NAME, - MangledName = MName, + OverloadedName = MName, IRName = IR, MaskedIRName = IR # "_mask", ManualCodegen = [{ @@ -1462,7 +1462,7 @@ multiclass RVVPseudoVNCVTBuiltin<string IR, string MName, string type_range, list<list<string>> suffixes_prototypes> { let Name = NAME, - MangledName = MName, + OverloadedName = MName, IRName = IR, MaskedIRName = IR # "_mask", ManualCodegen = [{ @@ -1792,7 +1792,7 @@ // 12.16. Vector Integer Move Instructions let HasMasked = false, UnMaskedPolicy = HasPassthruOperand, MaskedPolicy = NonePolicy in { - let MangledName = "vmv_v" in { + let OverloadedName = "vmv_v" in { defm vmv_v : RVVOutBuiltinSet<"vmv_v_v", "csil", [["v", "Uv", "UvUv"]]>; defm vmv_v : RVVOutBuiltinSet<"vmv_v_v", "csilxfd", @@ -2043,11 +2043,11 @@ // 17. Vector Permutation Instructions // 17.1. Integer Scalar Move Instructions let HasMasked = false, MaskedPolicy = NonePolicy in { - let HasVL = false, MangledName = "vmv_x" in + let HasVL = false, OverloadedName = "vmv_x" in defm vmv_x : RVVOp0BuiltinSet<"vmv_x_s", "csil", [["s", "ve", "ev"], ["s", "UvUe", "UeUv"]]>; - let MangledName = "vmv_s" in + let OverloadedName = "vmv_s" in defm vmv_s : RVVOutBuiltinSet<"vmv_s_x", "csil", [["x", "v", "vve"], ["x", "Uv", "UvUvUe"]]>; @@ -2055,10 +2055,10 @@ // 17.2. Floating-Point Scalar Move Instructions let HasMasked = false, MaskedPolicy = NonePolicy in { - let HasVL = false, MangledName = "vfmv_f" in + let HasVL = false, OverloadedName = "vfmv_f" in defm vfmv_f : RVVOp0BuiltinSet<"vfmv_f_s", "xfd", [["s", "ve", "ev"]]>; - let MangledName = "vfmv_s" in + let OverloadedName = "vfmv_s" in defm vfmv_s : RVVOutBuiltinSet<"vfmv_s_f", "xfd", [["f", "v", "vve"], ["x", "Uv", "UvUvUe"]]>; @@ -2144,7 +2144,7 @@ // LMUL truncation // C/C++ Operand: VecTy, IR Operand: VecTy, Index - let Name = "vlmul_trunc_v", MangledName = "vlmul_trunc", MaskedPolicy = NonePolicy, + let Name = "vlmul_trunc_v", OverloadedName = "vlmul_trunc", MaskedPolicy = NonePolicy, ManualCodegen = [{ { ID = Intrinsic::experimental_vector_extract; IntrinsicTypes = {ResultType, Ops[0]->getType()}; @@ -2162,7 +2162,7 @@ // LMUL extension // C/C++ Operand: SubVecTy, IR Operand: VecTy, SubVecTy, Index - let Name = "vlmul_ext_v", MangledName = "vlmul_ext", MaskedPolicy = NonePolicy, + let Name = "vlmul_ext_v", OverloadedName = "vlmul_ext", MaskedPolicy = NonePolicy, ManualCodegen = [{ ID = Intrinsic::experimental_vector_insert; IntrinsicTypes = {ResultType, Ops[0]->getType()};
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits