summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorJohannes Doerfert <jdoerfert@anl.gov>2019-08-16 19:49:00 +0000
committerJohannes Doerfert <jdoerfert@anl.gov>2019-08-16 19:49:00 +0000
commit66cf87e29090737acfbaa66f15464ee2f6c93e21 (patch)
treee14c97d4b634adf5a850ae599e5b75a075fca3c2 /llvm/lib
parentfe6dbadc0d53efdc34c096dd1695f23467ea6591 (diff)
downloadbcm5719-llvm-66cf87e29090737acfbaa66f15464ee2f6c93e21.tar.gz
bcm5719-llvm-66cf87e29090737acfbaa66f15464ee2f6c93e21.zip
[Attributor][NFC] Introduce aliases for call site attributes
Until we have call site specific liveness and/or value information there is no need to do call site specific deduction. Though, we need the symbols in follow up patches that make Attributor::getAAFor return a reference. llvm-svn: 369143
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/IPO/Attributor.cpp47
1 files changed, 40 insertions, 7 deletions
diff --git a/llvm/lib/Transforms/IPO/Attributor.cpp b/llvm/lib/Transforms/IPO/Attributor.cpp
index 97f0c69067d..5ba0f1b90b7 100644
--- a/llvm/lib/Transforms/IPO/Attributor.cpp
+++ b/llvm/lib/Transforms/IPO/Attributor.cpp
@@ -496,6 +496,9 @@ struct AANoUnwindFunction final : public AANoUnwindImpl {
void trackStatistics() const override { STATS_DECLTRACK_FN_ATTR(nounwind) }
};
+/// NoUnwind attribute deduction for a call sites.
+using AANoUnwindCallSite = AANoUnwindFunction;
+
/// --------------------- Function Return Values -------------------------------
/// "Attribute" that collects all potential returned values and the return
@@ -831,6 +834,9 @@ struct AAReturnedValuesFunction final : public AAReturnedValuesImpl {
void trackStatistics() const override { STATS_DECLTRACK_ARG_ATTR(returned) }
};
+/// Returned values information for a call sites.
+using AAReturnedValuesCallSite = AAReturnedValuesFunction;
+
/// ------------------------ NoSync Function Attribute -------------------------
struct AANoSyncImpl : AANoSync {
@@ -862,13 +868,6 @@ struct AANoSyncImpl : AANoSync {
static bool isNoSyncIntrinsic(Instruction *I);
};
-struct AANoSyncFunction final : public AANoSyncImpl {
- AANoSyncFunction(const IRPosition &IRP) : AANoSyncImpl(IRP) {}
-
- /// See AbstractAttribute::trackStatistics()
- void trackStatistics() const override { STATS_DECLTRACK_FN_ATTR(nosync) }
-};
-
bool AANoSyncImpl::isNonRelaxedAtomic(Instruction *I) {
if (!I->isAtomic())
return false;
@@ -1001,6 +1000,16 @@ ChangeStatus AANoSyncImpl::updateImpl(Attributor &A) {
return ChangeStatus::UNCHANGED;
}
+struct AANoSyncFunction final : public AANoSyncImpl {
+ AANoSyncFunction(const IRPosition &IRP) : AANoSyncImpl(IRP) {}
+
+ /// See AbstractAttribute::trackStatistics()
+ void trackStatistics() const override { STATS_DECLTRACK_FN_ATTR(nosync) }
+};
+
+/// NoSync attribute deduction for a call sites.
+using AANoSyncCallSite = AANoSyncFunction;
+
/// ------------------------ No-Free Attributes ----------------------------
struct AANoFreeImpl : public AANoFree {
@@ -1042,6 +1051,9 @@ struct AANoFreeFunction final : public AANoFreeImpl {
void trackStatistics() const override { STATS_DECLTRACK_FN_ATTR(nofree) }
};
+/// NoFree attribute deduction for a call sites.
+using AANoFreeCallSite = AANoFreeFunction;
+
/// ------------------------ NonNull Argument Attribute ------------------------
struct AANonNullImpl : AANonNull {
AANonNullImpl(const IRPosition &IRP) : AANonNull(IRP) {}
@@ -1178,6 +1190,9 @@ struct AANonNullCallSiteArgument final : AANonNullImpl {
void trackStatistics() const override { STATS_DECLTRACK_CSARG_ATTR(nonnull) }
};
+/// NonNull attribute deduction for a call sites.
+using AANonNullCallSiteReturned = AANonNullReturned;
+
/// ------------------------ Will-Return Attributes ----------------------------
// Helper function that checks whether a function has any cycle.
@@ -1256,6 +1271,9 @@ struct AAWillReturnFunction final : AAWillReturnImpl {
void trackStatistics() const override { STATS_DECLTRACK_FN_ATTR(norecurse) }
};
+/// WillReturn attribute deduction for a call sites.
+using AAWillReturnCallSite = AAWillReturnFunction;
+
/// ------------------------ NoAlias Argument Attribute ------------------------
struct AANoAliasImpl : AANoAlias {
@@ -1322,6 +1340,9 @@ struct AANoAliasReturned final : AANoAliasImpl {
void trackStatistics() const override { STATS_DECLTRACK_FNRET_ATTR(noalias) }
};
+/// NoAlias attribute deduction for a call site return value.
+using AANoAliasCallSiteReturned = AANoAliasReturned;
+
/// -------------------AAIsDead Function Attribute-----------------------
struct AAIsDeadImpl : public AAIsDead {
@@ -1599,6 +1620,9 @@ ChangeStatus AAIsDeadImpl::updateImpl(Attributor &A) {
return Status;
}
+/// Liveness information for a call sites.
+using AAIsDeadCallSite = AAIsDeadFunction;
+
/// -------------------- Dereferenceable Argument Attribute --------------------
struct DerefState : AbstractState {
@@ -1907,6 +1931,9 @@ ChangeStatus AADereferenceableCallSiteArgument::updateImpl(Attributor &A) {
: ChangeStatus::CHANGED;
}
+/// Dereferenceable attribute deduction for a call site return value.
+using AADereferenceableCallSiteReturned = AADereferenceableReturned;
+
// ------------------------ Align Argument Attribute ------------------------
struct AAAlignImpl : AAAlign {
@@ -2060,6 +2087,9 @@ ChangeStatus AAAlignCallSiteArgument::updateImpl(Attributor &A) {
: ChangeStatus::CHANGED;
}
+/// Align attribute deduction for a call site return value.
+using AAAlignCallSiteReturned = AAAlignReturned;
+
/// ------------------ Function No-Return Attribute ----------------------------
struct AANoReturnImpl : public AANoReturn {
AANoReturnImpl(const IRPosition &IRP) : AANoReturn(IRP) {}
@@ -2092,6 +2122,9 @@ struct AANoReturnFunction final : AANoReturnImpl {
void trackStatistics() const override { STATS_DECLTRACK_FN_ATTR(noreturn) }
};
+/// NoReturn attribute deduction for a call sites.
+using AANoReturnCallSite = AANoReturnFunction;
+
/// ----------------------------------------------------------------------------
/// Attributor
/// ----------------------------------------------------------------------------
OpenPOWER on IntegriCloud