[llvm] 1d5d074 - [Attributor] Reach optimistic fixpoint in AAValueSimplify when the value is constant or undef
Hideto Ueno via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 24 21:21:41 PST 2019
Author: Hideto Ueno
Date: 2019-12-25T14:18:34+09:00
New Revision: 1d5d074aef2a92e9db8f8dabf60281c1da8baa99
URL: https://github.com/llvm/llvm-project/commit/1d5d074aef2a92e9db8f8dabf60281c1da8baa99
DIFF: https://github.com/llvm/llvm-project/commit/1d5d074aef2a92e9db8f8dabf60281c1da8baa99.diff
LOG: [Attributor] Reach optimistic fixpoint in AAValueSimplify when the value is constant or undef
Summary:
As discussed in D71799, we have found that it is more useful to reach an optimistic fixpoint in AAValueSimpify when the value is constant or undef.
Reviewers: jdoerfert, sstefan1
Reviewed By: jdoerfert
Subscribers: baziotis, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D71852
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 b08bc1fda65c..deb11011f8e4 100644
--- a/llvm/lib/Transforms/IPO/Attributor.cpp
+++ b/llvm/lib/Transforms/IPO/Attributor.cpp
@@ -4072,6 +4072,14 @@ struct AAValueSimplifyImpl : AAValueSimplify {
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
@@ -4171,7 +4179,7 @@ struct AAValueSimplifyFloating : AAValueSimplifyImpl {
Value &V = getAnchorValue();
// TODO: add other stuffs
- if (isa<Constant>(V) || isa<UndefValue>(V))
+ if (isa<Constant>(V))
indicatePessimisticFixpoint();
}
More information about the llvm-commits
mailing list