Skip to content

Commit 5434156

Browse files
committed
LAA: add missed swap when inverting src, sink (NFC)
We miss swapping the types of the source and sink when the source and sink are inverted, leaving a footgun behind. Fix this.
1 parent 360a03c commit 5434156

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

llvm/lib/Analysis/LoopAccessAnalysis.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1921,6 +1921,7 @@ MemoryDepChecker::getDependenceDistanceStrideAndSize(
19211921
if (StrideAPtr && *StrideAPtr < 0) {
19221922
std::swap(Src, Sink);
19231923
std::swap(AInst, BInst);
1924+
std::swap(ATy, BTy);
19241925
std::swap(StrideAPtr, StrideBPtr);
19251926
}
19261927

0 commit comments

Comments
 (0)