Skip to content

Commit 70d02a3

Browse files
committed
[Attributor] Fix an issue that an access is skipped by mistake
When we check if an access can be skipped, there is a case that an inter-procedural interference access exists after a dominant write. Currently we rely on `AAInterFnReachability` to tell if the access can be reachable. If it is not, we can safely skip the access. However, it is based on an assumption that the AA exists. It is possible that the AA doesn't exist. In this case, we can't safely assume the acess can be skipped because we have to assume the access can reach. This can happen when `AAInterFnReachability` is not in the allowed AA list when creating the attributor, such as AMDGPUAttributor.
1 parent b024fd2 commit 70d02a3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/Transforms/IPO/AttributorAttributes.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1331,7 +1331,7 @@ struct AAPointerInfoImpl
13311331
// itself either.
13321332
bool Inserted = ExclusionSet.insert(&I).second;
13331333

1334-
if (!FnReachabilityAA ||
1334+
if (FnReachabilityAA &&
13351335
!FnReachabilityAA->instructionCanReach(
13361336
A, *LeastDominatingWriteInst,
13371337
*Acc.getRemoteInst()->getFunction(), &ExclusionSet))

0 commit comments

Comments
 (0)