diff options
| author | Johannes Doerfert <johannes@jdoerfert.de> | 2019-10-13 20:25:25 -0500 |
|---|---|---|
| committer | Johannes Doerfert <johannes@jdoerfert.de> | 2019-10-30 20:44:03 -0500 |
| commit | 12173e60ec430214f4035edd12720f86fe2c9588 (patch) | |
| tree | 41a6e419ec0d4c5f2dc99a9a125c413f3d4131cd | |
| parent | b2083c53824d6465344f831e5dd0302ba2c40668 (diff) | |
| download | bcm5719-llvm-12173e60ec430214f4035edd12720f86fe2c9588.tar.gz bcm5719-llvm-12173e60ec430214f4035edd12720f86fe2c9588.zip | |
[Attributor][NFC] Do not record dependences on fixed attributes
Since fixed values cannot change, we do not need to wait for it to
happen, we will never notify the dependent attribute anyway.
| -rw-r--r-- | llvm/include/llvm/Transforms/IPO/Attributor.h | 8 | ||||
| -rw-r--r-- | llvm/lib/Transforms/IPO/Attributor.cpp | 6 |
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; |

