Skip to content

Cherry-pick -ftime-report and -ftime-trace patches to Release branch#4880

Merged
llvm-beanz merged 3 commits intomicrosoft:release-1.7.2212from
llvm-beanz:cbieneman/cp-ftime-report
Dec 15, 2022
Merged

Cherry-pick -ftime-report and -ftime-trace patches to Release branch#4880
llvm-beanz merged 3 commits intomicrosoft:release-1.7.2212from
llvm-beanz:cbieneman/cp-ftime-report

Conversation

@llvm-beanz
Copy link
Copy Markdown
Collaborator

@llvm-beanz llvm-beanz commented Dec 14, 2022

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.

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
@llvm-beanz llvm-beanz added the for-release Issues and PRs prioritized for the upcoming release label Dec 14, 2022
@AppVeyorBot
Copy link
Copy Markdown

* 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 llvm-beanz changed the title Cherry-pick -ftime-report patches to Release branch Cherry-pick -ftime-report and -ftime-trace patches to Release branch Dec 14, 2022
@AppVeyorBot
Copy link
Copy Markdown

Copy link
Copy Markdown
Member

@hekota hekota left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are cherry-picks of commits that have already been reviewed, so I did not go though each line.

@llvm-beanz llvm-beanz merged commit e2c4ea5 into microsoft:release-1.7.2212 Dec 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

for-release Issues and PRs prioritized for the upcoming release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants