[PATCH] D62766: [Attributor] Deduce "nosync" function attribute.
Stefan Stipanovic via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 4 14:13:27 PDT 2019
sstefan1 updated this revision to Diff 203021.
sstefan1 added a comment.
small fixes
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D62766/new/
https://reviews.llvm.org/D62766
Files:
llvm/include/llvm/IR/Attributes.td
llvm/lib/Transforms/IPO/Attributor.cpp
Index: llvm/lib/Transforms/IPO/Attributor.cpp
===================================================================
--- llvm/lib/Transforms/IPO/Attributor.cpp
+++ llvm/lib/Transforms/IPO/Attributor.cpp
@@ -415,15 +415,13 @@
Failure == AtomicOrdering::Monotonic)
return false;
default:
- Ordering = AtomicOrdering::NotAtomic;
-
- break;
- // Relaxed.
- if (Ordering == AtomicOrdering::Unordered ||
- Ordering == AtomicOrdering::Monotonic)
- return false;
return true;
}
+ // Relaxed.
+ if (Ordering == AtomicOrdering::Unordered ||
+ Ordering == AtomicOrdering::Monotonic)
+ return false;
+ return true;
}
bool AANoSyncFunction::isVolatile(Instruction *I) const {
@@ -448,12 +446,9 @@
/// FIXME: We should ipmrove the handling of intrinsics.
for (Instruction *I : InfoCache.getReadOrWriteInstsForFunction(F)) {
ImmutableCallSite ICS(I);
- if(!ICS)
- continue;
-
auto *NoSyncAA = A.getAAFor<AANoSyncFunction>(*this, *I);
- if ((!NoSyncAA || !NoSyncAA->isAssumedNoSync()) &&
+ if (!ICS && (!NoSyncAA || !NoSyncAA->isAssumedNoSync()) &&
!ICS.hasFnAttr("nosync")) {
indicatePessimisticFixpoint();
return ChangeStatus::CHANGED;
Index: llvm/include/llvm/IR/Attributes.td
===================================================================
--- llvm/include/llvm/IR/Attributes.td
+++ llvm/include/llvm/IR/Attributes.td
@@ -107,7 +107,7 @@
def NoReturn : EnumAttr<"noreturn">;
/// Function does not synchronize.
-def NoSync : StrBoolAttr<"nofree">;
+def NoSync : StrBoolAttr<"nosync">;
/// Disable Indirect Branch Tracking.
def NoCfCheck : EnumAttr<"nocf_check">;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D62766.203021.patch
Type: text/x-patch
Size: 1686 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190604/51c557d7/attachment.bin>
More information about the llvm-commits
mailing list