[PATCH] D71852: [Attributor] Reach optimistic fixpoint in AAValueSimplify when the value is constant or undef

Hideto Ueno via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 24 20:35:58 PST 2019


uenoku updated this revision to Diff 235247.
uenoku added a comment.

Address comment.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D71852/new/

https://reviews.llvm.org/D71852

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


Index: llvm/lib/Transforms/IPO/Attributor.cpp
===================================================================
--- llvm/lib/Transforms/IPO/Attributor.cpp
+++ llvm/lib/Transforms/IPO/Attributor.cpp
@@ -3970,6 +3970,14 @@
     return Changed | AAValueSimplify::manifest(A);
   }
 
+  /// See AbstractState::indicatePessimisticFixpoint(...).
+  ChangeStatus indicatePessimisticFixpoint() override {
+    // NOTE: Associated value will be returned in a pessimistic fixpoint and is
+    // regarded as known. That's why`indicateOptimisticFixpoint` is called.
+    SimplifiedAssociatedValue = &getAssociatedValue();
+    return indicateOptimisticFixpoint();
+  }
+
 protected:
   // An assumed simplified value. Initially, it is set to Optional::None, which
   // means that the value is not clear under current assumption. If in the
@@ -4069,10 +4077,8 @@
     Value &V = getAnchorValue();
 
     // TODO: add other stuffs
-    if (isa<Constant>(V) || isa<UndefValue>(V)) {
-      SimplifiedAssociatedValue = &V;
-      indicateOptimisticFixpoint();
-    }
+    if (isa<Constant>(V))
+      indicatePessimisticFixpoint();
   }
 
   /// See AbstractAttribute::updateImpl(...).


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D71852.235247.patch
Type: text/x-patch
Size: 1174 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191225/6b3f39ff/attachment-0001.bin>


More information about the llvm-commits mailing list