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

Evgeny Shulgin via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 20 11:19:33 PDT 2022


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 because I suspect we'll get pretty wide variation between test bots in the build lab. Do you have an idea of how likely it is that this test will have different behavior depending on the machine?
I'd say, the test's outcome varies if behaviour of `CompilerInstance` varies. From my (imperfect) understanding of Clang/LLVM's architecture, its interface is pretty hermetic and we won't get inconsistent behaviour depending on the current machine as soon as we ran `Compiler.ExecuteAction(Action);`.
Since the code is machine-independents, I expect the same behaviour everywhere.

If we look on other tests, there are tests that seemingly take the machine's target triple https://github.com/llvm/llvm-project/blob/3fee9358baab54e4ed646a106297e7fb6f1b4cff/clang/unittests/CodeGen/TestCompiler.h#L40-L48 to fill some info in `CompilerInstance`.

But this is not the case in our test. Seems like the AST parsing is machine-independent 😃 


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