[PATCH] D106109: [Attributor] Add support for compound assignment for ChangeStatus
Shilei Tian via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 15 20:52:02 PDT 2021
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGc23da666b5be: [Attributor] Add support for compound assignment for ChangeStatus (authored by tianshilei1992).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D106109/new/
https://reviews.llvm.org/D106109
Files:
llvm/include/llvm/Transforms/IPO/Attributor.h
llvm/lib/Transforms/IPO/Attributor.cpp
llvm/lib/Transforms/IPO/OpenMPOpt.cpp
Index: llvm/lib/Transforms/IPO/OpenMPOpt.cpp
===================================================================
--- llvm/lib/Transforms/IPO/OpenMPOpt.cpp
+++ llvm/lib/Transforms/IPO/OpenMPOpt.cpp
@@ -3505,7 +3505,7 @@
switch (RFKind) {
case OMPRTL___kmpc_is_spmd_exec_mode:
- Changed = Changed | foldIsSPMDExecMode(A);
+ Changed |= foldIsSPMDExecMode(A);
break;
default:
llvm_unreachable("Unhandled OpenMP runtime function!");
Index: llvm/lib/Transforms/IPO/Attributor.cpp
===================================================================
--- llvm/lib/Transforms/IPO/Attributor.cpp
+++ llvm/lib/Transforms/IPO/Attributor.cpp
@@ -161,9 +161,17 @@
ChangeStatus llvm::operator|(ChangeStatus L, ChangeStatus R) {
return L == ChangeStatus::CHANGED ? L : R;
}
+ChangeStatus &llvm::operator|=(ChangeStatus &L, ChangeStatus R) {
+ L = L | R;
+ return L;
+}
ChangeStatus llvm::operator&(ChangeStatus L, ChangeStatus R) {
return L == ChangeStatus::UNCHANGED ? L : R;
}
+ChangeStatus &llvm::operator&=(ChangeStatus &L, ChangeStatus R) {
+ L = L & R;
+ return L;
+}
///}
bool AA::isValidInScope(const Value &V, const Function *Scope) {
Index: llvm/include/llvm/Transforms/IPO/Attributor.h
===================================================================
--- llvm/include/llvm/Transforms/IPO/Attributor.h
+++ llvm/include/llvm/Transforms/IPO/Attributor.h
@@ -177,7 +177,9 @@
};
ChangeStatus operator|(ChangeStatus l, ChangeStatus r);
+ChangeStatus &operator|=(ChangeStatus &l, ChangeStatus r);
ChangeStatus operator&(ChangeStatus l, ChangeStatus r);
+ChangeStatus &operator&=(ChangeStatus &l, ChangeStatus r);
enum class DepClassTy {
REQUIRED, ///< The target cannot be valid if the source is not.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D106109.359203.patch
Type: text/x-patch
Size: 1761 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210716/11fafffb/attachment.bin>
More information about the llvm-commits
mailing list