-
Notifications
You must be signed in to change notification settings - Fork 686
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
Backport -ftime-trace from upstream llvm & clang #4873
Merged
llvm-beanz
merged 3 commits into
microsoft:main
from
llvm-beanz:cbieneman/backport-ftime-trace
Dec 14, 2022
Merged
Backport -ftime-trace from upstream llvm & clang #4873
llvm-beanz
merged 3 commits into
microsoft:main
from
llvm-beanz:cbieneman/backport-ftime-trace
Dec 14, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This change back-ports the -ftime-trace feature implemented by Aras Pranckevičius (@aras-p) into DXC. Aras has a great blog post describing the motivaiton for this feature and how to use it (see: https://aras-p.info/blog/2019/01/16/time-trace-timeline-flame-chart-prof iler-for-Clang/). As shaders are getting more and more complex we need better timing data for ourselves as compiler writers and our users as HLSL writers to know how to improve compile times of complex shaders. This implementation is a starting point to give us data to help drive our efforts to improve compile-time performance. Because DXC's LLVM is very far removed from the version of LLVM the patch was originally written for this change is not strictly a cherry-pick of llvm/llvm-project@d880de2d19d46f7cfea7aa593602 458440bc1e8d. Instead this change is a manually applied and reconstructed patch with significant alterations along the way. The alaterations are performed by myself, but credit for the patch remains with @aras-p. Patch by Aras Pranckevičius (@aras-p).
I missed instrumentation hooks in the CallGraphSCCPassManager and the Function pass manager.
dmpots
approved these changes
Dec 14, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Touches a lot of places, but looks pretty straightforward. I didn't review the actual TimerProfile code closely since I assume that is an already well tested upstream component.
The actual dxc-specific changes seem reasonable to me.
llvm-beanz
added a commit
to llvm-beanz/DirectXShaderCompiler
that referenced
this pull request
Dec 14, 2022
* Backport -ftime-trace from upstream llvm & clang This change back-ports the -ftime-trace feature implemented by Aras Pranckevičius (@aras-p) into DXC. Aras has a great blog post describing the motivaiton for this feature and how to use it (see: https://aras-p.info/blog/2019/01/16/time-trace-timeline-flame-chart-prof iler-for-Clang/). As shaders are getting more and more complex we need better timing data for ourselves as compiler writers and our users as HLSL writers to know how to improve compile times of complex shaders. This implementation is a starting point to give us data to help drive our efforts to improve compile-time performance. Because DXC's LLVM is very far removed from the version of LLVM the patch was originally written for this change is not strictly a cherry-pick of llvm/llvm-project@d880de2d19d46f7cfea7aa593602 458440bc1e8d. Instead this change is a manually applied and reconstructed patch with significant alterations along the way. The alaterations are performed by myself, but credit for the patch remains with @aras-p. Patch by Aras Pranckevičius (@aras-p).
llvm-beanz
added a commit
that referenced
this pull request
Dec 15, 2022
…4880) * Enable -ftime-report flag (#4736) This just surfaces and plumbs throug the -ftime-report clang flag in dxc.exe. -ftime-report prints timing data for different parts of the compile to help identify and track down performance issues. When using the dxcompiler library interface the output for the time report is returned as a DXC_OUT_TIME_REPORT buffer. I've set up the -ftime-report tests to run against the DXC command line. On Windows this usees the hcttestcmds file, on Linux (and windows if enabled) this will test through a lit shell suite. * Unbuffer raw_string_stream (#4872) Double buffering a string stream writing in memory is silly. Upstream LLVM made this change a few years ago based on analysis that most string implementations are sane: llvm/llvm-project@65b1361 * Backport -ftime-trace from upstream llvm & clang (#4873) * Backport -ftime-trace from upstream llvm & clang This change back-ports the -ftime-trace feature implemented by Aras Pranckevičius (@aras-p) into DXC. Aras has a great blog post describing the motivaiton for this feature and how to use it (see: https://aras-p.info/blog/2019/01/16/time-trace-timeline-flame-chart-prof iler-for-Clang/). As shaders are getting more and more complex we need better timing data for ourselves as compiler writers and our users as HLSL writers to know how to improve compile times of complex shaders. This implementation is a starting point to give us data to help drive our efforts to improve compile-time performance. Because DXC's LLVM is very far removed from the version of LLVM the patch was originally written for this change is not strictly a cherry-pick of llvm/llvm-project@d880de2d19d46f7cfea7aa593602 458440bc1e8d. Instead this change is a manually applied and reconstructed patch with significant alterations along the way. The alaterations are performed by myself, but credit for the patch remains with @aras-p. Patch by Aras Pranckevičius (@aras-p).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change back-ports the -ftime-trace feature implemented by Aras Pranckevičius (@aras-p) into DXC.
Aras has a great blog post describing the motivaiton for this feature and how to use it (see:
https://aras-p.info/blog/2019/01/16/time-trace-timeline-flame-chart-prof iler-for-Clang/).
As shaders are getting more and more complex we need better timing data for ourselves as compiler writers and our users as HLSL writers to know how to improve compile times of complex shaders.
This implementation is a starting point to give us data to help drive our efforts to improve compile-time performance.
Because DXC's LLVM is very far removed from the version of LLVM the patch was originally written for this change is not strictly a cherry-pick of
llvm/llvm-project@d880de2d19d46f7cfea7aa593602 458440bc1e8d. Instead this change is a manually applied and reconstructed patch with significant alterations along the way. The alaterations are performed by myself, but credit for the patch remains with @aras-p.
Patch by Aras Pranckevičius (@aras-p).