[llvm] [Attributor] Fix an issue that an access is skipped by mistake (PR #101862)
via llvm-commits
llvm-commits at lists.llvm.org
Sat Aug 3 20:40:53 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-llvm-transforms
Author: Shilei Tian (shiltian)
<details>
<summary>Changes</summary>
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.
---
Full diff: https://github.com/llvm/llvm-project/pull/101862.diff
1 Files Affected:
- (modified) llvm/lib/Transforms/IPO/AttributorAttributes.cpp (+1-1)
``````````diff
diff --git a/llvm/lib/Transforms/IPO/AttributorAttributes.cpp b/llvm/lib/Transforms/IPO/AttributorAttributes.cpp
index cd31c4be1c1da..1a551faec6dff 100644
--- a/llvm/lib/Transforms/IPO/AttributorAttributes.cpp
+++ b/llvm/lib/Transforms/IPO/AttributorAttributes.cpp
@@ -1331,7 +1331,7 @@ struct AAPointerInfoImpl
// itself either.
bool Inserted = ExclusionSet.insert(&I).second;
- if (!FnReachabilityAA ||
+ if (FnReachabilityAA &&
!FnReachabilityAA->instructionCanReach(
A, *LeastDominatingWriteInst,
*Acc.getRemoteInst()->getFunction(), &ExclusionSet))
``````````
</details>
https://github.com/llvm/llvm-project/pull/101862
More information about the llvm-commits
mailing list