[PATCH] D136022: [clang] Add time profile for constant evaluation

Evgeny Shulgin via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Oct 15 10:32:11 PDT 2022


Izaron added a comment.

We can use this file as an example: `ConstProfiler.cpp` https://reviews.llvm.org/P8296
The code does a really big constant evaluation.

This is the generated json **before** the patch: `before.json` https://reviews.llvm.org/P8294
Giving this json to https://www.speedscope.app/, we get a big empty gap where the constant evaluation is being done.
link to screenshot <https://user-images.githubusercontent.com/5406399/195999887-64ea75c0-b995-476d-be85-f65c95600132.png>

This is the generated json **after** the patch: `after.json` https://reviews.llvm.org/P8295
The empty gap is filled with four events.
link to screenshot <https://user-images.githubusercontent.com/5406399/195999990-130731f6-39fa-41fa-92c3-fef297df9e24.png>

You can use this command for generating the json:

  clang++ ConstProfiler.cpp -std=c++20 -c -ftime-trace -ftime-trace-granularity=50

P.S. I'm not sure how to write tests to cover the patch, but I'll find this out =)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D136022/new/

https://reviews.llvm.org/D136022



More information about the cfe-commits mailing list