[PATCH] D141575: [WIP][3/N][Clang][RISCV][NFC] Clarify edge cases of RVVIntrinsic::getSupportedMaskedPolicies for clarity
Yueh-Ting (eop) Chen via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Jan 12 00:52:41 PST 2023
eopXD created this revision.
Herald added subscribers: sunshaoce, VincentWu, vkmr, frasercrmck, evandro, luismarques, apazos, sameer.abuasal, s.egerton, Jim, benna, psnobl, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, jrtc27, shiva0217, kito-cheng, niosHD, sabuasal, simoncook, johnrusso, rbar, asb, arichardson.
Herald added a project: All.
eopXD requested review of this revision.
Herald added subscribers: cfe-commits, pcwang-thead, MaskRay.
Herald added a project: clang.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D141575
Files:
clang/lib/Support/RISCVVIntrinsicUtils.cpp
Index: clang/lib/Support/RISCVVIntrinsicUtils.cpp
===================================================================
--- clang/lib/Support/RISCVVIntrinsicUtils.cpp
+++ clang/lib/Support/RISCVVIntrinsicUtils.cpp
@@ -13,6 +13,7 @@
#include "llvm/ADT/StringMap.h"
#include "llvm/ADT/StringSet.h"
#include "llvm/ADT/Twine.h"
+#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/raw_ostream.h"
#include <numeric>
#include <optional>
@@ -998,16 +999,18 @@
Policy::PolicyType::Undisturbed), // TUMU
Policy(Policy::PolicyType::Agnostic,
Policy::PolicyType::Undisturbed)}; // TAMU
-
- if (HasTailPolicy)
+ if (HasTailPolicy && !HasMaskPolicy)
return {Policy(Policy::PolicyType::Undisturbed,
Policy::PolicyType::Agnostic, true), // TUM
Policy(Policy::PolicyType::Agnostic, Policy::PolicyType::Agnostic,
true)}; // TAM
-
- return {
- Policy(Policy::PolicyType::Omit, Policy::PolicyType::Agnostic), // MA
- Policy(Policy::PolicyType::Omit, Policy::PolicyType::Undisturbed)}; // MU
+ if (!HasTailPolicy && HasMaskPolicy)
+ return {
+ Policy(Policy::PolicyType::Omit, Policy::PolicyType::Agnostic), // MA
+ Policy(Policy::PolicyType::Omit,
+ Policy::PolicyType::Undisturbed)}; // MU
+ llvm_unreachable("An RVV instruction should not be without both tail policy "
+ "and mask policy");
}
void RVVIntrinsic::updateNamesAndPolicy(bool IsMasked, bool HasPolicy,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D141575.488512.patch
Type: text/x-patch
Size: 1545 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230112/6a8d6759/attachment.bin>
More information about the cfe-commits
mailing list