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

2022-11-02 Thread Trass3r via Phabricator via cfe-commits
Trass3r added a comment. Thanks for this! When I experimented with this for #42754 I also came across functions like Expr::isConstantInitializer ExprCons

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

2022-10-22 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron added a comment. In D136022#3877399 , @dyung wrote: > Hi @Izaron, several of our internal tests that run tests using `-ftime-trace` > started crashing when run which I bisected back to your change. I have filed > issue #58551

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

2022-10-22 Thread Douglas Yung via Phabricator via cfe-commits
dyung added a comment. Hi @Izaron, several of our internal tests that run tests using `-ftime-trace` started crashing when run which I bisected back to your change. I have filed issue #58551 for it, can you take a look? Repository: rG LLVM

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

2022-10-21 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron added inline comments. Comment at: clang/unittests/Support/TimeProfilerTest.cpp:11 +#include "clang/Frontend/FrontendActions.h" +#include "clang/Lex/PreprocessorOptions.h" + thakis wrote: > Why is this in clang/unittests/Support (a new binary to boot)? Thi

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

2022-10-21 Thread Nico Weber via Phabricator via cfe-commits
thakis added inline comments. Comment at: clang/unittests/Support/TimeProfilerTest.cpp:11 +#include "clang/Frontend/FrontendActions.h" +#include "clang/Lex/PreprocessorOptions.h" + Why is this in clang/unittests/Support (a new binary to boot)? This doesn't use a

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

2022-10-21 Thread Evgeny Shulgin via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG27d8eedd5a3c: [clang] Add time profile for constant evaluation (authored by Izaron). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTIO

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

2022-10-21 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron updated this revision to Diff 469771. Izaron added a comment. Mention this in the release notes. Thanks to Aaron for reviewing! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D136022/new/ https://reviews.llvm.org/D136022 Files: clang/docs/R

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

2022-10-21 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. LGTM! Please be sure to add a release note to alert folks to the time profiler becoming more awesome. :-) Comment at: clang/unittests/Support/TimeProfilerTest.

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

2022-10-20 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron added inline comments. Comment at: clang/unittests/Support/TimeProfilerTest.cpp:197-198 + + // NOTE: If this test is failing, run this test with + // `llvm::errs() << TraceGraph;` and change the assert above. +} aaron.ballman wrote: > This bit worries me

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

2022-10-20 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/unittests/Support/TimeProfilerTest.cpp:197-198 + + // NOTE: If this test is failing, run this test with + // `llvm::errs() << TraceGraph;` and change the assert above. +} This bit worries me because I suspe

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

2022-10-20 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron updated this revision to Diff 469159. Izaron added a comment. Fix optionals with `value_or` Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D136022/new/ https://reviews.llvm.org/D136022 Files: clang/lib/AST/ExprConstant.cpp clang/unittests

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

2022-10-19 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron updated this revision to Diff 469098. Izaron added a comment. Fix CMakeLists.txt Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D136022/new/ https://reviews.llvm.org/D136022 Files: clang/lib/AST/ExprConstant.cpp clang/unittests/CMakeLists

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

2022-10-19 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron added a comment. The test doesn't cover exactly all new traces though. For example I couldn't write a code that runs into the `EvaluateAsInt` method 🤔 If you have an idea for some funky constexpr code that can be tested, please write here =) Repository: rG LLVM Github Monorepo CHANG

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

2022-10-19 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron added a comment. In D136022#3861245 , @jloser wrote: > I'd like to see some tests through before I approve. Thanks for the greenlight! I added a test that compiles a chunk of code and then checks the time trace graph in a human-readable form.

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

2022-10-19 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron updated this revision to Diff 469096. Izaron marked 4 inline comments as done. Izaron added a comment. Add time profiler test. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D136022/new/ https://reviews.llvm.org/D136022 Files: clang/lib/AST

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

2022-10-18 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. Thank you for working on this, having more detailed timing information for where we're spending time in the frontend will really help us to evaluate where we need to work on frontend performance. Comment at: clang/lib/AST/ExprConstant.cpp:15257

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

2022-10-16 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/lib/AST/ExprConstant.cpp:15257 + }); + // FIXME: Evaluating initializers for large array and record types can cause what about `Expr::EvaluateASRvalue` and `Expr::isPotentialConstantExpression`? Repository:

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

2022-10-16 Thread Joe Loser via Phabricator via cfe-commits
jloser added a comment. I like the idea of this — +1 for the direction. I'd like to see some tests through before I approve. Thanks for working on this! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D136022/new/ https://reviews.llvm.org/D136022

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

2022-10-15 Thread Evgeny Shulgin via Phabricator via cfe-commits
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

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

2022-10-15 Thread Evgeny Shulgin via Phabricator via cfe-commits
Izaron created this revision. Izaron added reviewers: aaron.ballman, cor3ntin, anton-afanasyev, mbs-modular, jloser. Herald added a project: All. Izaron requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Add time profiler for various constexp