summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/include/llvm/Transforms/IPO/Attributor.h8
-rw-r--r--llvm/lib/Transforms/IPO/Attributor.cpp6
2 files changed, 9 insertions, 5 deletions
diff --git a/llvm/include/llvm/Transforms/IPO/Attributor.h b/llvm/include/llvm/Transforms/IPO/Attributor.h
index 90d88ce21e9..43c1811059a 100644
--- a/llvm/include/llvm/Transforms/IPO/Attributor.h
+++ b/llvm/include/llvm/Transforms/IPO/Attributor.h
@@ -733,9 +733,7 @@ struct Attributor {
/// be beneficial to avoid false dependences but it requires the users of
/// `getAAFor` to explicitly record true dependences through this method.
void recordDependence(const AbstractAttribute &FromAA,
- const AbstractAttribute &ToAA) {
- QueryMap[&FromAA].insert(const_cast<AbstractAttribute *>(&ToAA));
- }
+ const AbstractAttribute &ToAA);
/// Introduce a new abstract attribute into the fixpoint analysis.
///
@@ -907,7 +905,7 @@ private:
AA.update(*this);
if (TrackDependence && AA.getState().isValidState())
- QueryMap[&AA].insert(const_cast<AbstractAttribute *>(QueryingAA));
+ recordDependence(AA, const_cast<AbstractAttribute &>(*QueryingAA));
return AA;
}
@@ -929,7 +927,7 @@ private:
KindToAbstractAttributeMap.lookup(&AAType::ID))) {
// Do not register a dependence on an attribute with an invalid state.
if (TrackDependence && AA->getState().isValidState())
- QueryMap[AA].insert(const_cast<AbstractAttribute *>(QueryingAA));
+ recordDependence(*AA, const_cast<AbstractAttribute &>(*QueryingAA));
return AA;
}
return nullptr;
diff --git a/llvm/lib/Transforms/IPO/Attributor.cpp b/llvm/lib/Transforms/IPO/Attributor.cpp
index b397f5a1655..a18be0c7849 100644
--- a/llvm/lib/Transforms/IPO/Attributor.cpp
+++ b/llvm/lib/Transforms/IPO/Attributor.cpp
@@ -4711,6 +4711,12 @@ void Attributor::initializeInformationCache(Function &F) {
}
}
+void Attributor::recordDependence(const AbstractAttribute &FromAA,
+ const AbstractAttribute &ToAA) {
+ if (!FromAA.getState().isAtFixpoint())
+ QueryMap[&FromAA].insert(const_cast<AbstractAttribute *>(&ToAA));
+}
+
void Attributor::identifyDefaultAbstractAttributes(Function &F) {
if (!VisitedFunctions.insert(&F).second)
return;
OpenPOWER on IntegriCloud