@@ -1093,6 +1093,13 @@ struct AAPointerInfoImpl
1093
1093
return State::numOffsetBins ();
1094
1094
}
1095
1095
virtual bool reachesReturn () const override { return ReachesReturn; }
1096
+ ChangeStatus setReachesReturn (bool Val) {
1097
+ if (ReachesReturn == Val)
1098
+ return ChangeStatus::UNCHANGED;
1099
+
1100
+ ReachesReturn = Val;
1101
+ return ChangeStatus::CHANGED;
1102
+ }
1096
1103
1097
1104
bool forallInterferingAccesses (
1098
1105
AA::RangeTy Range,
@@ -1380,12 +1387,12 @@ struct AAPointerInfoImpl
1380
1387
if (!OtherAA.getState ().isValidState () || !isValidState ())
1381
1388
return indicatePessimisticFixpoint ();
1382
1389
1390
+ ChangeStatus Changed = ChangeStatus::UNCHANGED;
1383
1391
const auto &OtherAAImpl = static_cast <const AAPointerInfoImpl &>(OtherAA);
1384
1392
bool IsByval = OtherAAImpl.getAssociatedArgument ()->hasByValAttr ();
1385
- ReachesReturn = OtherAAImpl.ReachesReturn ;
1393
+ Changed |= setReachesReturn ( OtherAAImpl.ReachesReturn ) ;
1386
1394
1387
1395
// Combine the accesses bin by bin.
1388
- ChangeStatus Changed = ChangeStatus::UNCHANGED;
1389
1396
const auto &State = OtherAAImpl.getState ();
1390
1397
for (const auto &It : State) {
1391
1398
for (auto Index : It.getSecond ()) {
@@ -1681,8 +1688,10 @@ ChangeStatus AAPointerInfoFloating::updateImpl(Attributor &A) {
1681
1688
// Returns are allowed if they are in the associated functions. Users can
1682
1689
// then check the call site return. Returns from other functions can't be
1683
1690
// tracked and are cause for invalidation.
1684
- if (auto *RI = dyn_cast<ReturnInst>(Usr))
1685
- return ReachesReturn = RI->getFunction () == getAssociatedFunction ();
1691
+ if (auto *RI = dyn_cast<ReturnInst>(Usr)) {
1692
+ Changed |= setReachesReturn (RI->getFunction () == getAssociatedFunction ());
1693
+ return ReachesReturn;
1694
+ }
1686
1695
1687
1696
// For PHIs we need to take care of the recurrence explicitly as the value
1688
1697
// might change while we iterate through a loop. For now, we give up if
0 commit comments