-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
assembly data flow graph #1158
Comments
Agreed: I'd ideally love to parse llvm-mca output, or better still have it output parseable JSON of what happened. Then I can use any number of graph library layouts to try and show the information. We already have CFG: https://godbolt.org/z/dFqf4H |
Yeah though the current CFG code is quite ad-hoc, parsing the assembly manually. Edit: I quickly hacked dot file emission into mca for a simple execution order visualization: L1:
movapd xmm1, [esi+eax]
mulpd xmm1, xmm2
movapd xmm0, [edi+eax]
subpd xmm0, xmm1
movapd [edi+eax], xmm0
add eax, 16
cmp eax, ecx
jz L1 |
Please note that
produces better graphs - colors encoding regions. Maybe useful. |
@OfekShilon Is there an equivalent of this for data flow? It looks like opt is generating a control flow graph here |
No ,sorry. I was lead hear by a link from the suggestion regarding cfg + data-dep, and saw that the start of the discussion touched on cfg so thought I'd comment here. Please note that IR cfg (as the opt passes dot-cfg or view-cfg emit) is not strictly equivalent to assembly cfg (which is already available). Personally I think both are useful. |
I just discovered the llvm-mca integration, that's awesome!
With the -timeline option you do get an idea of the instruction dependency chains:
https://godbolt.org/z/-cMrJI
But it would be nicer if there was a graph like the following, just on an MCInst level:
![flow graph](https://raw.githubusercontent.com/k3ut0i/llvm-dataflow-graphs/master/ctrl-data.png)
https://github.com/k3ut0i/llvm-dataflow-graphs
The text was updated successfully, but these errors were encountered: