Skip to content

Commit 77a6b35

Browse files
committed
[Attributor][NFCI] Do not track unnecessary dependences
If we do not look at assumed information there is no need to track dependences.
1 parent 680f638 commit 77a6b35

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

llvm/lib/Transforms/IPO/Attributor.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1685,7 +1685,10 @@ static int64_t getKnownNonNullAndDerefBytesForUse(
16851685

16861686
unsigned ArgNo = ICS.getArgumentNo(U);
16871687
IRPosition IRP = IRPosition::callsite_argument(ICS, ArgNo);
1688-
auto &DerefAA = A.getAAFor<AADereferenceable>(QueryingAA, IRP);
1688+
// As long as we only use known information there is no need to track
1689+
// dependences here.
1690+
auto &DerefAA = A.getAAFor<AADereferenceable>(QueryingAA, IRP,
1691+
/* TrackDependence */ false);
16891692
IsNonNull |= DerefAA.isKnownNonNull();
16901693
return DerefAA.getKnownDereferenceableBytes();
16911694
}
@@ -1718,8 +1721,10 @@ static int64_t getKnownNonNullAndDerefBytesForUse(
17181721
GetPointerBaseWithConstantOffset(UseV, Offset, DL,
17191722
/*AllowNonInbounds*/ false)) {
17201723
if (Base == &AssociatedValue) {
1721-
auto &DerefAA =
1722-
A.getAAFor<AADereferenceable>(QueryingAA, IRPosition::value(*Base));
1724+
// As long as we only use known information there is no need to track
1725+
// dependences here.
1726+
auto &DerefAA = A.getAAFor<AADereferenceable>(
1727+
QueryingAA, IRPosition::value(*Base), /* TrackDependence */ false);
17231728
IsNonNull |= (!NullPointerIsDefined && DerefAA.isKnownNonNull());
17241729
IsNonNull |= (!NullPointerIsDefined && (Offset != 0));
17251730
int64_t DerefBytes = DerefAA.getKnownDereferenceableBytes();

0 commit comments

Comments
 (0)