From: eopXD Date: Sat, 7 Jan 2023 08:05:41 +0000 (-0800) Subject: [2/15][Clang][RISCV][NFC] Rename Policy::IsPolicyNone to IsUnspecifed X-Git-Tag: upstream/17.0.6~19859 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=74252fb115b42bab2c050086603c1385c8a2ffb6;p=platform%2Fupstream%2Fllvm.git [2/15][Clang][RISCV][NFC] Rename Policy::IsPolicyNone to IsUnspecifed The original naming is inaccurate. An RVV intrinsic always comes with a corresponding policy behavior. When the policy is unspecified for an intrinsic, its policy behavior should be it's default assumption. This is the 2nd commit of a patch-set that aims to change the default policy for RVV intrinsics from TAMU to TAMA. Please refer to the cover letter in the 1st commit (D141573) for an overview. Reviewed By: kito-cheng Differential Revision: https://reviews.llvm.org/D141574 --- diff --git a/clang/include/clang/Support/RISCVVIntrinsicUtils.h b/clang/include/clang/Support/RISCVVIntrinsicUtils.h index a0c72d9..425784b 100644 --- a/clang/include/clang/Support/RISCVVIntrinsicUtils.h +++ b/clang/include/clang/Support/RISCVVIntrinsicUtils.h @@ -93,7 +93,7 @@ enum class TypeModifier : uint8_t { }; struct Policy { - bool PolicyNone = false; + bool IsUnspecified = false; enum PolicyType { Undisturbed, Agnostic, @@ -102,7 +102,7 @@ struct Policy { PolicyType TailPolicy = Omit; PolicyType MaskPolicy = Omit; bool IntrinsicWithoutMU = false; - Policy() : PolicyNone(true) {} + Policy() : IsUnspecified(true) {} Policy(PolicyType _TailPolicy, PolicyType _MaskPolicy, bool _IntrinsicWithoutMU = false) : TailPolicy(_TailPolicy), MaskPolicy(_MaskPolicy), @@ -150,11 +150,11 @@ struct Policy { return MaskPolicy == Undisturbed && TailPolicy == Omit; } - bool isPolicyNonePolicy() const { return PolicyNone; } + bool isUnspecified() const { return IsUnspecified; } bool operator==(const Policy &Other) const { - return PolicyNone == Other.PolicyNone && TailPolicy == Other.TailPolicy && - MaskPolicy == Other.MaskPolicy && + return IsUnspecified == Other.IsUnspecified && + TailPolicy == Other.TailPolicy && MaskPolicy == Other.MaskPolicy && IntrinsicWithoutMU == Other.IntrinsicWithoutMU; } @@ -431,7 +431,7 @@ public: return IntrinsicTypes; } Policy getPolicyAttrs() const { - assert(PolicyAttrs.PolicyNone == false); + assert(PolicyAttrs.IsUnspecified == false); return PolicyAttrs; } unsigned getPolicyAttrsBits() const { @@ -441,7 +441,7 @@ public: // constexpr unsigned TAIL_AGNOSTIC_MASK_AGNOSTIC = 3; // FIXME: how about value 2 // int PolicyAttrs = TAIL_UNDISTURBED; - assert(PolicyAttrs.PolicyNone == false); + assert(PolicyAttrs.IsUnspecified == false); if (PolicyAttrs.isTUMAPolicy()) return 2; diff --git a/clang/lib/Support/RISCVVIntrinsicUtils.cpp b/clang/lib/Support/RISCVVIntrinsicUtils.cpp index 5022426..93ade07 100644 --- a/clang/lib/Support/RISCVVIntrinsicUtils.cpp +++ b/clang/lib/Support/RISCVVIntrinsicUtils.cpp @@ -917,9 +917,9 @@ llvm::SmallVector RVVIntrinsic::computeBuiltinTypes( // Update PolicyAttrs if need (TA or TAMA) for compute builtin types. if (PolicyAttrs.isMAPolicy()) PolicyAttrs.TailPolicy = Policy::PolicyType::Agnostic; // TAMA - if (PolicyAttrs.isPolicyNonePolicy()) { + if (PolicyAttrs.isUnspecified()) { if (!IsMasked) { - PolicyAttrs.PolicyNone = false; + PolicyAttrs.IsUnspecified = false; PolicyAttrs.TailPolicy = Policy::PolicyType::Agnostic; // TA } } @@ -1016,8 +1016,8 @@ void RVVIntrinsic::updateNamesAndPolicy(bool IsMasked, bool HasPolicy, OverloadedName += suffix; }; - if (PolicyAttrs.isPolicyNonePolicy()) { - PolicyAttrs.PolicyNone = false; + if (PolicyAttrs.isUnspecified()) { + PolicyAttrs.IsUnspecified = false; if (IsMasked) { Name += "_m"; // FIXME: Currently _m default policy implementation is different with