[Attributor][NFC] Avoid unnecessary liveness queries

If we know everything is live there is no need to query for liveness.
Indicating a pessimistic fixpoint will cause the state to be "invalid"
which will cause the Attributor to not return the AAIsDead on request,
which will prevent us from querying isAssumedDead().

llvm-svn: 368223
This commit is contained in:
Johannes Doerfert 2019-08-07 22:32:38 +00:00
parent 14a0493a88
commit d620781872
1 changed files with 10 additions and 0 deletions

View File

@ -1617,6 +1617,16 @@ ChangeStatus AAIsDeadImpl::updateImpl(Attributor &A,
dbgs() << "[AAIsDead] AssumedLiveBlocks: " << AssumedLiveBlocks.size()
<< " Total number of blocks: " << getAnchorScope().size() << "\n");
// If we know everything is live there is no need to query for liveness.
if (NoReturnCalls.empty() &&
getAnchorScope().size() == AssumedLiveBlocks.size()) {
// Indicating a pessimistic fixpoint will cause the state to be "invalid"
// which will cause the Attributor to not return the AAIsDead on request,
// which will prevent us from querying isAssumedDead().
indicatePessimisticFixpoint();
assert(!isValidState() && "Expected an invalid state!");
}
return Status;
}