[llvm] [llvm][Support] Enable pass timing in StandardInstrumentations constr… (PR #108983)
Tarun Prabhu via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 18 18:48:36 PDT 2024
tarunprabhu wrote:
> I meant `TimePassesIsEnabled.getNumOccurrences() ? TimePassesIsEnabled : EnableTimePasses`. So only use it if it's explicitly set.
Ugh! So this gets a little messier. The actual command line option is `static` in `[llvm/lib/IR/PassTimingInfo.cpp](https://github.com/llvm/llvm-project/blob/009398b3b37f7d653b4371120944f74cad934992/llvm/lib/IR/PassTimingInfo.cpp#L40)`. `TimePassesIsEnabled` is a global that is the `cl::Location` for that option.
To do as you suggest, that `cl::opt` would have to be exposed. If that is ok, I could do it, but it seems to be a step "backwards".
> And ideally we'd change clang to also use this rather than setting `llvm::TimePassesIsEnabled`
I think part of the trouble there is that the legacy pass manager still uses this global. In clang, `llvm::TimePassesIsEnabled` is set in order to print timing information when `-ftime-report` is passed on the command-line. We might have to wait until the backends switch to the new pass manager before we can stop setting it in `clang`. This is the same issue that we are running into with `flang` as well.
https://github.com/llvm/llvm-project/pull/108983
More information about the llvm-commits
mailing list