[PATCH] D141756: [WIP][6/N][Clang][RISCV][NFC] Instructions with a mask destination register is always tail agnostic
Yueh-Ting (eop) Chen via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sat Jan 14 11:24:17 PST 2023
eopXD updated this revision to Diff 489301.
eopXD added a comment.
I was mistaken. Nothing was mistakenly fused. Recover the patch.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D141756/new/
https://reviews.llvm.org/D141756
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
@@ -917,9 +917,6 @@
PolicyScheme DefaultScheme, Policy PolicyAttrs) {
SmallVector<PrototypeDescriptor> NewPrototype(Prototype.begin(),
Prototype.end());
- // Update PolicyAttrs if need (TA or TAMA) for compute builtin types.
- if (PolicyAttrs.isMAPolicy())
- PolicyAttrs.TailPolicy = Policy::PolicyType::Agnostic; // TAMA
bool HasPassthruOp = DefaultScheme == PolicyScheme::HasPassthruOperand;
if (IsMasked) {
// If HasMaskedOffOperand, insert result type as first input operand if
@@ -996,8 +993,8 @@
Policy::PolicyType::Agnostic)}; // TAM
if (!HasTailPolicy && HasMaskPolicy)
return {
- Policy(Policy::PolicyType::Omit, Policy::PolicyType::Agnostic), // MA
- Policy(Policy::PolicyType::Omit,
+ Policy(Policy::PolicyType::Agnostic, Policy::PolicyType::Agnostic), // MA
+ Policy(Policy::PolicyType::Agnostic,
Policy::PolicyType::Undisturbed)}; // MU
llvm_unreachable("An RVV instruction should not be without both tail policy "
"and mask policy");
@@ -1036,6 +1033,10 @@
appendPolicySuffix("_tum");
else if (PolicyAttrs.isTAMAPolicy() && !HasMaskPolicy)
appendPolicySuffix("_tam");
+ else if (PolicyAttrs.isMUPolicy() && !HasTailPolicy)
+ appendPolicySuffix("_mu");
+ else if (PolicyAttrs.isMAPolicy() && !HasTailPolicy)
+ appendPolicySuffix("_ma");
else if (PolicyAttrs.isTUMUPolicy())
appendPolicySuffix("_tumu");
else if (PolicyAttrs.isTAMUPolicy())
@@ -1048,13 +1049,7 @@
appendPolicySuffix("_tu");
else if (PolicyAttrs.isTAPolicy() && !IsMasked)
appendPolicySuffix("_ta");
- else if (PolicyAttrs.isMUPolicy() && !HasTailPolicy) {
- appendPolicySuffix("_mu");
- PolicyAttrs.TailPolicy = Policy::PolicyType::Agnostic;
- } else if (PolicyAttrs.isMAPolicy() && !HasTailPolicy) {
- appendPolicySuffix("_ma");
- PolicyAttrs.TailPolicy = Policy::PolicyType::Agnostic;
- } else
+ 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
@@ -130,11 +130,11 @@
}
bool isMAPolicy() const {
- return MaskPolicy == Agnostic && TailPolicy == Omit;
+ return MaskPolicy == Agnostic;
}
bool isMUPolicy() const {
- return MaskPolicy == Undisturbed && TailPolicy == Omit;
+ return MaskPolicy == Undisturbed;
}
bool isUnspecified() const { return IsUnspecified; }
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D141756.489301.patch
Type: text/x-patch
Size: 2915 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230114/acf05ba0/attachment.bin>
More information about the cfe-commits
mailing list