The current da printer shows the dependence without indicating which instructions are being considered as the src vs dst. It also silently ignores call instructions, despite the fact that they create confused dependence edges to other memory instructions. This patch addresses these two issues plus a couple of minor non-functional improvements.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/Analysis/DependenceAnalysis.cpp | ||
---|---|---|
198 | Printing that last seems a bit odd to me. How about moving it up and have something like "da analyze - Src" << *SrcI << " --> Dst :" << *DstI? | |
llvm/test/Analysis/DependenceAnalysis/Dump.ll | ||
19 | Please check the complete output (should not be too much in the case) and it helps with getting the complete picture of the changed output. |
Check the complete da print output in the LIT test as per Florian's comment.
llvm/lib/Analysis/DependenceAnalysis.cpp | ||
---|---|---|
198 | I thought about putting it on the same line as "da analyze", but that would break every test case in da, and also makes the output a bit cluttered and hard to read (it would be hard to find the actual dependence info). I could put it at the beginning and indent the "da analyze - " part. ie change the output from: 'Dependence Analysis' for function 'foo': da analyze - none! Src: store float %conv, float* %arrayidx, align 4 --> Dst: store float %conv, float* %arrayidx, align 4 da analyze - confused! Src: store float %conv, float* %arrayidx, align 4 --> Dst: call void @bar(float* %A) da analyze - confused! Src: call void @bar(float* %A) --> Dst: call void @bar(float* %A) to 'Dependence Analysis' for function 'foo': Src: store float %conv, float* %arrayidx, align 4 --> Dst: store float %conv, float* %arrayidx, align 4 da analyze - none! Src: store float %conv, float* %arrayidx, align 4 --> Dst: call void @bar(float* %A) da analyze - confused! Src: call void @bar(float* %A) --> Dst: call void @bar(float* %A) da analyze - confused! Do people prefer that? |
Nice. I always found this a bit awkward.
llvm/lib/Analysis/DependenceAnalysis.cpp | ||
---|---|---|
198 | I would say the second probably makes more sense for people unfamiliar with the output before. It shows what it is analysing, then the result it came up with. |
Addressed review comments.
llvm/lib/Analysis/DependenceAnalysis.cpp | ||
---|---|---|
198 | Sure. I've made it print the second way. |
LGTM thanks! I agree that putting analyzed instructions before the result looks good!
Printing that last seems a bit odd to me. How about moving it up and have something like "da analyze - Src" << *SrcI << " --> Dst :" << *DstI?