[llvm] r369143 - [Attributor][NFC] Introduce aliases for call site attributes
Johannes Doerfert via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 16 12:49:01 PDT 2019
Author: jdoerfert
Date: Fri Aug 16 12:49:00 2019
New Revision: 369143
URL: http://llvm.org/viewvc/llvm-project?rev=369143&view=rev
Log:
[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.
Modified:
llvm/trunk/lib/Transforms/IPO/Attributor.cpp
Modified: llvm/trunk/lib/Transforms/IPO/Attributor.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/Attributor.cpp?rev=369143&r1=369142&r2=369143&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/Attributor.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/Attributor.cpp Fri Aug 16 12:49:00 2019
@@ -496,6 +496,9 @@ struct AANoUnwindFunction final : public
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 :
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(At
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 A
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 :
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 : AAWi
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 : AANoAli
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(At
return Status;
}
+/// Liveness information for a call sites.
+using AAIsDeadCallSite = AAIsDeadFunction;
+
/// -------------------- Dereferenceable Argument Attribute --------------------
struct DerefState : AbstractState {
@@ -1907,6 +1931,9 @@ ChangeStatus AADereferenceableCallSiteAr
: 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::up
: 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 : AANoRe
void trackStatistics() const override { STATS_DECLTRACK_FN_ATTR(noreturn) }
};
+/// NoReturn attribute deduction for a call sites.
+using AANoReturnCallSite = AANoReturnFunction;
+
/// ----------------------------------------------------------------------------
/// Attributor
/// ----------------------------------------------------------------------------
More information about the llvm-commits
mailing list