[llvm] 77a6b35 - [Attributor][NFCI] Do not track unnecessary dependences

Johannes Doerfert via llvm-commits llvm-commits at lists.llvm.org
Sat Nov 2 13:33:21 PDT 2019


Author: Johannes Doerfert
Date: 2019-11-02T15:26:30-05:00
New Revision: 77a6b358b51f363d0f1626579720e654ca5aae9a

URL: https://github.com/llvm/llvm-project/commit/77a6b358b51f363d0f1626579720e654ca5aae9a
DIFF: https://github.com/llvm/llvm-project/commit/77a6b358b51f363d0f1626579720e654ca5aae9a.diff

LOG: [Attributor][NFCI] Do not track unnecessary dependences

If we do not look at assumed information there is no need to track
dependences.

Added: 
    

Modified: 
    llvm/lib/Transforms/IPO/Attributor.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/IPO/Attributor.cpp b/llvm/lib/Transforms/IPO/Attributor.cpp
index 08c682dfcd6d..b7471a32faf4 100644
--- a/llvm/lib/Transforms/IPO/Attributor.cpp
+++ b/llvm/lib/Transforms/IPO/Attributor.cpp
@@ -1685,7 +1685,10 @@ static int64_t getKnownNonNullAndDerefBytesForUse(
 
     unsigned ArgNo = ICS.getArgumentNo(U);
     IRPosition IRP = IRPosition::callsite_argument(ICS, ArgNo);
-    auto &DerefAA = A.getAAFor<AADereferenceable>(QueryingAA, IRP);
+    // As long as we only use known information there is no need to track
+    // dependences here.
+    auto &DerefAA = A.getAAFor<AADereferenceable>(QueryingAA, IRP,
+                                                  /* TrackDependence */ false);
     IsNonNull |= DerefAA.isKnownNonNull();
     return DerefAA.getKnownDereferenceableBytes();
   }
@@ -1718,8 +1721,10 @@ static int64_t getKnownNonNullAndDerefBytesForUse(
           GetPointerBaseWithConstantOffset(UseV, Offset, DL,
                                            /*AllowNonInbounds*/ false)) {
     if (Base == &AssociatedValue) {
-      auto &DerefAA =
-          A.getAAFor<AADereferenceable>(QueryingAA, IRPosition::value(*Base));
+      // As long as we only use known information there is no need to track
+      // dependences here.
+      auto &DerefAA = A.getAAFor<AADereferenceable>(
+          QueryingAA, IRPosition::value(*Base), /* TrackDependence */ false);
       IsNonNull |= (!NullPointerIsDefined && DerefAA.isKnownNonNull());
       IsNonNull |= (!NullPointerIsDefined && (Offset != 0));
       int64_t DerefBytes = DerefAA.getKnownDereferenceableBytes();


        


More information about the llvm-commits mailing list