diff options
| author | Johannes Doerfert <johannes@jdoerfert.de> | 2019-10-13 21:10:31 -0500 |
|---|---|---|
| committer | Johannes Doerfert <johannes@jdoerfert.de> | 2019-10-30 20:47:47 -0500 |
| commit | 2dad729f0c7b8665d362baecd8ff52449b26051d (patch) | |
| tree | bbae4f8bf3d4892003d9311d65062edf75acb366 /llvm/lib/Transforms/IPO | |
| parent | 12173e60ec430214f4035edd12720f86fe2c9588 (diff) | |
| download | bcm5719-llvm-2dad729f0c7b8665d362baecd8ff52449b26051d.tar.gz bcm5719-llvm-2dad729f0c7b8665d362baecd8ff52449b26051d.zip | |
[Attributor][NFC] Eagerly mark attributes as fixed.
If an attribute did not query any optimistic (=non-fixed) information to
justify its state, we know the attribute state will not change anymore.
Thus, we can indicate an optimistic fixpoint.
Diffstat (limited to 'llvm/lib/Transforms/IPO')
| -rw-r--r-- | llvm/lib/Transforms/IPO/Attributor.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/IPO/Attributor.cpp b/llvm/lib/Transforms/IPO/Attributor.cpp index a18be0c7849..567ec782950 100644 --- a/llvm/lib/Transforms/IPO/Attributor.cpp +++ b/llvm/lib/Transforms/IPO/Attributor.cpp @@ -4496,9 +4496,16 @@ ChangeStatus Attributor::run(Module &M) { // Update all abstract attribute in the work list and record the ones that // changed. for (AbstractAttribute *AA : Worklist) - if (!isAssumedDead(*AA, nullptr)) - if (AA->update(*this) == ChangeStatus::CHANGED) + if (!AA->getState().isAtFixpoint() && !isAssumedDead(*AA, nullptr)) { + QueriedNonFixAA = false; + if (AA->update(*this) == ChangeStatus::CHANGED) { ChangedAAs.push_back(AA); + } else if (!QueriedNonFixAA) { + // If the attribute did not query any non-fix information, the state + // will not change and we can indicate that right away. + AA->getState().indicateOptimisticFixpoint(); + } + } // Check if we recompute the dependences in the next iteration. RecomputeDependences = (DepRecomputeInterval > 0 && @@ -4713,8 +4720,11 @@ 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)); + if (FromAA.getState().isAtFixpoint()) + return; + + QueryMap[&FromAA].insert(const_cast<AbstractAttribute *>(&ToAA)); + QueriedNonFixAA = true; } void Attributor::identifyDefaultAbstractAttributes(Function &F) { |

