[PATCH] D141575: [3/15][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
Tue Jan 24 00:07:44 PST 2023
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG063802843c20: [3/15][Clang][RISCV][NFC] Clarify edge cases of RVVIntrinsic… (authored by eopXD).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D141575/new/
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>
@@ -992,16 +993,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.491624.patch
Type: text/x-patch
Size: 1545 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230124/08881690/attachment-0001.bin>
More information about the cfe-commits
mailing list