Skip to content

Commit 719a728

Browse files
committed
[15/15][Clang][RISCV][NFC] Set data member under Policy as constants
The object is now correct by construction. This is the 15th 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. Depends on D141793. Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D141796
1 parent 488d171 commit 719a728

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

clang/include/clang/Support/RISCVVIntrinsicUtils.h

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,15 +92,22 @@ enum class TypeModifier : uint8_t {
9292
LLVM_MARK_AS_BITMASK_ENUM(LMUL1),
9393
};
9494

95-
struct Policy {
96-
bool IsUnspecified = false;
95+
class Policy {
96+
public:
9797
enum PolicyType {
9898
Undisturbed,
9999
Agnostic,
100100
};
101-
PolicyType TailPolicy = Agnostic;
102-
PolicyType MaskPolicy = Agnostic;
101+
bool IsUnspecified = false;
102+
103+
private:
104+
// The default assumption for an RVV instruction is TAMA, as an undisturbed
105+
// policy generally will affect the performance of an out-of-order core.
106+
const PolicyType TailPolicy = Agnostic;
107+
const PolicyType MaskPolicy = Agnostic;
103108
bool HasTailPolicy, HasMaskPolicy;
109+
110+
public:
104111
Policy(bool HasTailPolicy, bool HasMaskPolicy)
105112
: IsUnspecified(true), HasTailPolicy(HasTailPolicy),
106113
HasMaskPolicy(HasMaskPolicy) {}

0 commit comments

Comments
 (0)