[llvm] 3b04d11 - [Attributor][NFCI] Use AA::hasAssumedIRAttr for NoSync
Johannes Doerfert via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 6 21:30:31 PDT 2023
Author: Johannes Doerfert
Date: 2023-07-06T21:30:04-07:00
New Revision: 3b04d119b2b3c4c88e647d8a270b9f22cbd4ea9a
URL: https://github.com/llvm/llvm-project/commit/3b04d119b2b3c4c88e647d8a270b9f22cbd4ea9a
DIFF: https://github.com/llvm/llvm-project/commit/3b04d119b2b3c4c88e647d8a270b9f22cbd4ea9a.diff
LOG: [Attributor][NFCI] Use AA::hasAssumedIRAttr for NoSync
Added:
Modified:
llvm/lib/Transforms/IPO/AttributorAttributes.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/IPO/AttributorAttributes.cpp b/llvm/lib/Transforms/IPO/AttributorAttributes.cpp
index 3c3252e7179c47..d682de6e3c4847 100644
--- a/llvm/lib/Transforms/IPO/AttributorAttributes.cpp
+++ b/llvm/lib/Transforms/IPO/AttributorAttributes.cpp
@@ -1071,11 +1071,13 @@ struct AAPointerInfoImpl
SmallVector<std::pair<const Access *, bool>, 8> InterferingAccesses;
Function &Scope = *I.getFunction();
- const auto *NoSyncAA = A.getAAFor<AANoSync>(
- QueryingAA, IRPosition::function(Scope), DepClassTy::OPTIONAL);
+ bool IsKnownNoSync;
+ bool IsAssumedNoSync = AA::hasAssumedIRAttr<Attribute::NoSync>(
+ A, &QueryingAA, IRPosition::function(Scope), DepClassTy::OPTIONAL,
+ IsKnownNoSync);
const auto *ExecDomainAA = A.lookupAAFor<AAExecutionDomain>(
IRPosition::function(Scope), &QueryingAA, DepClassTy::NONE);
- bool AllInSameNoSyncFn = NoSyncAA && NoSyncAA->isAssumedNoSync();
+ bool AllInSameNoSyncFn = IsAssumedNoSync;
bool InstIsExecutedByInitialThreadOnly =
ExecDomainAA && ExecDomainAA->isExecutedByInitialThreadOnly(I);
bool InstIsExecutedInAlignedRegion =
More information about the llvm-commits
mailing list