eopXD updated this revision to Diff 492437. eopXD added a comment. Update code. The removal of `PolicyAttrs.IsUnspecified = false;` under
void RVVIntrinsic::updateNamesAndPolicy(bool IsMasked, bool HasPolicy, std::string &Name, std::string &BuiltinName, std::string &OverloadedName, Policy &PolicyAttrs) { /* ... */ if (PolicyAttrs.isUnspecified()) { } is incorrect becasue the `==` operator of the `Policy` object still uses it. So repeating builtin-s were created (becasue repeating ones are not recognized as duplicates), causing `riscv_vector_builtin_cg.inc` to explode. The updated patch now only adds `const` qualifier to `TailPolicy` and `MaskPolicy`. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D141796/new/ https://reviews.llvm.org/D141796 Files: clang/include/clang/Support/RISCVVIntrinsicUtils.h Index: clang/include/clang/Support/RISCVVIntrinsicUtils.h =================================================================== --- clang/include/clang/Support/RISCVVIntrinsicUtils.h +++ clang/include/clang/Support/RISCVVIntrinsicUtils.h @@ -92,15 +92,22 @@ LLVM_MARK_AS_BITMASK_ENUM(LMUL1), }; -struct Policy { - bool IsUnspecified = false; +class Policy { +public: enum PolicyType { Undisturbed, Agnostic, }; - PolicyType TailPolicy = Agnostic; - PolicyType MaskPolicy = Agnostic; + bool IsUnspecified = false; + +private: + // The default assumption for an RVV instruction is TAMA, as an undisturbed + // policy generally will affect the performance of an out-of-order core. + const PolicyType TailPolicy = Agnostic; + const PolicyType MaskPolicy = Agnostic; bool HasTailPolicy, HasMaskPolicy; + +public: Policy(bool HasTailPolicy, bool HasMaskPolicy) : IsUnspecified(true), HasTailPolicy(HasTailPolicy), HasMaskPolicy(HasMaskPolicy) {}
Index: clang/include/clang/Support/RISCVVIntrinsicUtils.h =================================================================== --- clang/include/clang/Support/RISCVVIntrinsicUtils.h +++ clang/include/clang/Support/RISCVVIntrinsicUtils.h @@ -92,15 +92,22 @@ LLVM_MARK_AS_BITMASK_ENUM(LMUL1), }; -struct Policy { - bool IsUnspecified = false; +class Policy { +public: enum PolicyType { Undisturbed, Agnostic, }; - PolicyType TailPolicy = Agnostic; - PolicyType MaskPolicy = Agnostic; + bool IsUnspecified = false; + +private: + // The default assumption for an RVV instruction is TAMA, as an undisturbed + // policy generally will affect the performance of an out-of-order core. + const PolicyType TailPolicy = Agnostic; + const PolicyType MaskPolicy = Agnostic; bool HasTailPolicy, HasMaskPolicy; + +public: Policy(bool HasTailPolicy, bool HasMaskPolicy) : IsUnspecified(true), HasTailPolicy(HasTailPolicy), HasMaskPolicy(HasMaskPolicy) {}
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits