@@ -5067,6 +5067,8 @@ struct AAValueSimplifyImpl : AAValueSimplify {
5067
5067
void initialize (Attributor &A) override {
5068
5068
if (getAssociatedValue ().getType ()->isVoidTy ())
5069
5069
indicatePessimisticFixpoint ();
5070
+ if (A.hasSimplificationCallback (getIRPosition ()))
5071
+ indicatePessimisticFixpoint ();
5070
5072
}
5071
5073
5072
5074
// / See AbstractAttribute::getAsStr().
@@ -5400,9 +5402,7 @@ struct AAValueSimplifyFloating : AAValueSimplifyImpl {
5400
5402
5401
5403
// / See AbstractAttribute::initialize(...).
5402
5404
void initialize (Attributor &A) override {
5403
- // FIXME: This might have exposed a SCC iterator update bug in the old PM.
5404
- // Needs investigation.
5405
- // AAValueSimplifyImpl::initialize(A);
5405
+ AAValueSimplifyImpl::initialize (A);
5406
5406
Value &V = getAnchorValue ();
5407
5407
5408
5408
// TODO: add other stuffs
@@ -5639,6 +5639,7 @@ struct AAValueSimplifyCallSiteReturned : AAValueSimplifyImpl {
5639
5639
: AAValueSimplifyImpl(IRP, A) {}
5640
5640
5641
5641
void initialize (Attributor &A) override {
5642
+ AAValueSimplifyImpl::initialize (A);
5642
5643
if (!getAssociatedFunction ())
5643
5644
indicatePessimisticFixpoint ();
5644
5645
}
@@ -7888,6 +7889,20 @@ struct AAValueConstantRangeImpl : AAValueConstantRange {
7888
7889
AAValueConstantRangeImpl (const IRPosition &IRP, Attributor &A)
7889
7890
: AAValueConstantRange(IRP, A) {}
7890
7891
7892
+ // / See AbstractAttribute::initialize(..).
7893
+ void initialize (Attributor &A) override {
7894
+ if (A.hasSimplificationCallback (getIRPosition ())) {
7895
+ indicatePessimisticFixpoint ();
7896
+ return ;
7897
+ }
7898
+
7899
+ // Intersect a range given by SCEV.
7900
+ intersectKnown (getConstantRangeFromSCEV (A, getCtxI ()));
7901
+
7902
+ // Intersect a range given by LVI.
7903
+ intersectKnown (getConstantRangeFromLVI (A, getCtxI ()));
7904
+ }
7905
+
7891
7906
// / See AbstractAttribute::getAsStr().
7892
7907
const std::string getAsStr () const override {
7893
7908
std::string Str;
@@ -8019,15 +8034,6 @@ struct AAValueConstantRangeImpl : AAValueConstantRange {
8019
8034
return getAssumed ().intersectWith (SCEVR).intersectWith (LVIR);
8020
8035
}
8021
8036
8022
- // / See AbstractAttribute::initialize(..).
8023
- void initialize (Attributor &A) override {
8024
- // Intersect a range given by SCEV.
8025
- intersectKnown (getConstantRangeFromSCEV (A, getCtxI ()));
8026
-
8027
- // Intersect a range given by LVI.
8028
- intersectKnown (getConstantRangeFromLVI (A, getCtxI ()));
8029
- }
8030
-
8031
8037
// / Helper function to create MDNode for range metadata.
8032
8038
static MDNode *
8033
8039
getMDNodeForConstantRange (Type *Ty, LLVMContext &Ctx,
@@ -8157,6 +8163,9 @@ struct AAValueConstantRangeFloating : AAValueConstantRangeImpl {
8157
8163
// / See AbstractAttribute::initialize(...).
8158
8164
void initialize (Attributor &A) override {
8159
8165
AAValueConstantRangeImpl::initialize (A);
8166
+ if (isAtFixpoint ())
8167
+ return ;
8168
+
8160
8169
Value &V = getAssociatedValue ();
8161
8170
8162
8171
if (auto *C = dyn_cast<ConstantInt>(&V)) {
@@ -8177,6 +8186,7 @@ struct AAValueConstantRangeFloating : AAValueConstantRangeImpl {
8177
8186
8178
8187
if (isa<BinaryOperator>(&V) || isa<CmpInst>(&V) || isa<CastInst>(&V))
8179
8188
return ;
8189
+
8180
8190
// If it is a load instruction with range metadata, use it.
8181
8191
if (LoadInst *LI = dyn_cast<LoadInst>(&V))
8182
8192
if (auto *RangeMD = LI->getMetadata (LLVMContext::MD_range)) {
@@ -8504,6 +8514,14 @@ struct AAPotentialValuesImpl : AAPotentialValues {
8504
8514
AAPotentialValuesImpl (const IRPosition &IRP, Attributor &A)
8505
8515
: AAPotentialValues(IRP, A) {}
8506
8516
8517
+ // / See AbstractAttribute::initialize(..).
8518
+ void initialize (Attributor &A) override {
8519
+ if (A.hasSimplificationCallback (getIRPosition ()))
8520
+ indicatePessimisticFixpoint ();
8521
+ else
8522
+ AAPotentialValues::initialize (A);
8523
+ }
8524
+
8507
8525
// / See AbstractAttribute::getAsStr().
8508
8526
const std::string getAsStr () const override {
8509
8527
std::string Str;
@@ -8561,6 +8579,10 @@ struct AAPotentialValuesFloating : AAPotentialValuesImpl {
8561
8579
8562
8580
// / See AbstractAttribute::initialize(..).
8563
8581
void initialize (Attributor &A) override {
8582
+ AAPotentialValuesImpl::initialize (A);
8583
+ if (isAtFixpoint ())
8584
+ return ;
8585
+
8564
8586
Value &V = getAssociatedValue ();
8565
8587
8566
8588
if (auto *C = dyn_cast<ConstantInt>(&V)) {
@@ -9093,6 +9115,10 @@ struct AAPotentialValuesCallSiteArgument : AAPotentialValuesFloating {
9093
9115
9094
9116
// / See AbstractAttribute::initialize(..).
9095
9117
void initialize (Attributor &A) override {
9118
+ AAPotentialValuesImpl::initialize (A);
9119
+ if (isAtFixpoint ())
9120
+ return ;
9121
+
9096
9122
Value &V = getAssociatedValue ();
9097
9123
9098
9124
if (auto *C = dyn_cast<ConstantInt>(&V)) {
0 commit comments