Cherry-pick -ftime-report and -ftime-trace patches to Release branch#4880
Merged
llvm-beanz merged 3 commits intomicrosoft:release-1.7.2212from Dec 15, 2022
Merged
Conversation
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.
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 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).
hekota
approved these changes
Dec 15, 2022
Member
hekota
left a comment
There was a problem hiding this comment.
These are cherry-picks of commits that have already been reviewed, so I did not go though each line.
This file contains hidden or 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
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 PR cherry-picks back three changes made to main which expose the -ftime-report and -ftime-trace options to the DXC command line and API interfaces and resolves a bug the first commit introduced.