[llvm] r368223 - [Attributor][NFC] Avoid unnecessary liveness queries

Johannes Doerfert via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 7 15:32:38 PDT 2019


Author: jdoerfert
Date: Wed Aug  7 15:32:38 2019
New Revision: 368223

URL: http://llvm.org/viewvc/llvm-project?rev=368223&view=rev
Log:
[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().

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=368223&r1=368222&r2=368223&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/Attributor.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/Attributor.cpp Wed Aug  7 15:32:38 2019
@@ -1617,6 +1617,16 @@ ChangeStatus AAIsDeadImpl::updateImpl(At
       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;
 }
 




More information about the llvm-commits mailing list