[llvm] LAA: add missed swap when inverting src, sink (NFC) (PR #122254)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 9 03:17:21 PST 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-llvm-analysis
Author: Ramkumar Ramachandra (artagnon)
<details>
<summary>Changes</summary>
We miss swapping the types of the source and sink when the source and sink are inverted, leaving a footgun behind. Fix this.
---
Full diff: https://github.com/llvm/llvm-project/pull/122254.diff
1 Files Affected:
- (modified) llvm/lib/Analysis/LoopAccessAnalysis.cpp (+1)
``````````diff
diff --git a/llvm/lib/Analysis/LoopAccessAnalysis.cpp b/llvm/lib/Analysis/LoopAccessAnalysis.cpp
index 2c75d5625cb66d..de0f81c0b6a4bf 100644
--- a/llvm/lib/Analysis/LoopAccessAnalysis.cpp
+++ b/llvm/lib/Analysis/LoopAccessAnalysis.cpp
@@ -1921,6 +1921,7 @@ MemoryDepChecker::getDependenceDistanceStrideAndSize(
if (StrideAPtr && *StrideAPtr < 0) {
std::swap(Src, Sink);
std::swap(AInst, BInst);
+ std::swap(ATy, BTy);
std::swap(StrideAPtr, StrideBPtr);
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/122254
More information about the llvm-commits
mailing list