[PATCH] D141768: [11/15][Clang][RISCV][NFC] Remove Policy::PolicyType::Omit
Yueh-Ting (eop) Chen via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Jan 24 07:59:09 PST 2023
eopXD updated this revision to Diff 491805.
eopXD edited the summary of this revision.
eopXD added a comment.
Rebase to latest main.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D141768/new/
https://reviews.llvm.org/D141768
Files:
clang/include/clang/Support/RISCVVIntrinsicUtils.h
clang/lib/Support/RISCVVIntrinsicUtils.cpp
Index: clang/lib/Support/RISCVVIntrinsicUtils.cpp
===================================================================
--- clang/lib/Support/RISCVVIntrinsicUtils.cpp
+++ clang/lib/Support/RISCVVIntrinsicUtils.cpp
@@ -969,10 +969,10 @@
llvm::SmallVector<Policy>
RVVIntrinsic::getSupportedUnMaskedPolicies(bool HasTailPolicy,
bool HasMaskPolicy) {
- return {Policy(Policy::PolicyType::Undisturbed, Policy::PolicyType::Omit,
- HasTailPolicy, HasMaskPolicy), // TU
- Policy(Policy::PolicyType::Agnostic, Policy::PolicyType::Omit,
- HasTailPolicy, HasMaskPolicy)}; // TA
+ return {
+ Policy(Policy::PolicyType::Undisturbed, HasTailPolicy,
+ HasMaskPolicy), // TU
+ Policy(Policy::PolicyType::Agnostic, HasTailPolicy, HasMaskPolicy)}; // TA
}
llvm::SmallVector<Policy>
@@ -1034,28 +1034,33 @@
BuiltinName += "_ta";
}
} else {
- if (PolicyAttrs.isTUMAPolicy() && !PolicyAttrs.hasMaskPolicy())
- appendPolicySuffix("_tum");
- else if (PolicyAttrs.isTAMAPolicy() && !PolicyAttrs.hasMaskPolicy())
- appendPolicySuffix("_tam");
- else if (PolicyAttrs.isMUPolicy() && !PolicyAttrs.hasTailPolicy())
- appendPolicySuffix("_mu");
- else if (PolicyAttrs.isMAPolicy() && !PolicyAttrs.hasTailPolicy())
- appendPolicySuffix("_ma");
- else if (PolicyAttrs.isTUMUPolicy())
- appendPolicySuffix("_tumu");
- else if (PolicyAttrs.isTAMUPolicy())
- appendPolicySuffix("_tamu");
- else if (PolicyAttrs.isTUMAPolicy())
- appendPolicySuffix("_tuma");
- else if (PolicyAttrs.isTAMAPolicy())
- appendPolicySuffix("_tama");
- else if (PolicyAttrs.isTUPolicy() && !IsMasked)
- appendPolicySuffix("_tu");
- else if (PolicyAttrs.isTAPolicy() && !IsMasked)
- appendPolicySuffix("_ta");
- else
- llvm_unreachable("Unhandled policy condition");
+ if (IsMasked) {
+ if (PolicyAttrs.isTUMAPolicy() && !PolicyAttrs.hasMaskPolicy())
+ appendPolicySuffix("_tum");
+ else if (PolicyAttrs.isTAMAPolicy() && !PolicyAttrs.hasMaskPolicy())
+ appendPolicySuffix("_tam");
+ else if (PolicyAttrs.isMUPolicy() && !PolicyAttrs.hasTailPolicy())
+ appendPolicySuffix("_mu");
+ else if (PolicyAttrs.isMAPolicy() && !PolicyAttrs.hasTailPolicy())
+ appendPolicySuffix("_ma");
+ else if (PolicyAttrs.isTUMUPolicy())
+ appendPolicySuffix("_tumu");
+ else if (PolicyAttrs.isTAMUPolicy())
+ appendPolicySuffix("_tamu");
+ else if (PolicyAttrs.isTUMAPolicy())
+ appendPolicySuffix("_tuma");
+ else if (PolicyAttrs.isTAMAPolicy())
+ appendPolicySuffix("_tama");
+ else
+ llvm_unreachable("Unhandled policy condition");
+ } else {
+ if (PolicyAttrs.isTUPolicy())
+ appendPolicySuffix("_tu");
+ else if (PolicyAttrs.isTAPolicy())
+ appendPolicySuffix("_ta");
+ else
+ llvm_unreachable("Unhandled policy condition");
+ }
}
}
Index: clang/include/clang/Support/RISCVVIntrinsicUtils.h
===================================================================
--- clang/include/clang/Support/RISCVVIntrinsicUtils.h
+++ clang/include/clang/Support/RISCVVIntrinsicUtils.h
@@ -97,7 +97,6 @@
enum PolicyType {
Undisturbed,
Agnostic,
- Omit, // No policy required.
};
PolicyType TailPolicy = Agnostic;
PolicyType MaskPolicy = Undisturbed;
@@ -105,6 +104,9 @@
Policy(bool HasTailPolicy, bool HasMaskPolicy)
: IsUnspecified(true), HasTailPolicy(HasTailPolicy),
HasMaskPolicy(HasMaskPolicy) {}
+ Policy(PolicyType TailPolicy, bool HasTailPolicy, bool HasMaskPolicy)
+ : TailPolicy(TailPolicy), HasTailPolicy(HasTailPolicy),
+ HasMaskPolicy(HasMaskPolicy) {}
Policy(PolicyType TailPolicy, PolicyType MaskPolicy, bool HasTailPolicy,
bool HasMaskPolicy)
: TailPolicy(TailPolicy), MaskPolicy(MaskPolicy),
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D141768.491805.patch
Type: text/x-patch
Size: 4019 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230124/edcfbf94/attachment-0001.bin>
More information about the cfe-commits
mailing list