[llvm] [LAA] Fix incorrect dependency classification. (PR #70819)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 27 03:03:59 PST 2023


fhahn wrote:

> > IIUC we should still swap source and sink for printing, as otherwise it may be confusing that the difference is not what we expect (Sink - Src)?
> > Would be good to also add a test for the debug output.
> 
> I must have missed this comment. I think we should not be altering the order of Sink and Source when printing them, because it would be as if we claimed that the Sink is the Source and the Source is the Sink, which is not the case. All we are doing is inverting the subtraction operands because one preceeds the other in the memory layout. Having said that @fhahn are you happy with the updated description and rebase?

They are still swapped for computing the distance (even though `std::swap` isn't used any longer), so for all places that use the distance, they should be considered swapped IIUC. As I mentioned earlier, `Distance` is supposed to be `(Sink - Src)`. The only place that requires them in program order is the read/write info for `couldPreventStoreLoadForward`, which probably deserves a comment.

https://github.com/llvm/llvm-project/pull/70819


More information about the llvm-commits mailing list