[PATCH] D87034: [KnownBits] Implement accurate unsigned and signed max and min
Nikita Popov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 8 09:52:53 PDT 2020
nikic added a comment.
In D87034#2260562 <https://reviews.llvm.org/D87034#2260562>, @foad wrote:
> Thanks. I wonder whether the number of calls to KnownBits and/or APInt constructors really affects compile time, as long as the APInts are all <= 64 bits (so they don't have to allocate any extra storage). If it //does// make a difference then KnownBits.h could probably be improved quite a lot e.g. by using rvalue references to avoid lots of copies.
Ah no, this was just intended as cleanup. It doesn't have a practical impact on compile-time.
> Is there an easy way for me to reproduce one of the compile-time-tracker's tests on my own machine? E.g. compiling "sqlite3" under perf stat?
What I do is run `ninja sqlite3 -v` (or whatever the benchmark is) in test-suite and then prepend `perf stat` or `valgrind --tool=callgrind` before the printed compilation command. Results in something like...
> valgrind --tool=callgrind /path/to/llvm-project/build/bin/clang -DNDEBUG -O3 -w -Werror=date-time -save-stats=obj -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DSQLITE_OMIT_LOAD_EXTENSION=1 -DSQLITE_THREADSAFE=0 -I. -save-stats=obj -MD -MT MultiSource/Applications/sqlite3/CMakeFiles/sqlite3.dir/sqlite3.c.o -MF MultiSource/Applications/sqlite3/CMakeFiles/sqlite3.dir/sqlite3.c.o.d -o MultiSource/Applications/sqlite3/CMakeFiles/sqlite3.dir/sqlite3.c.o -c ../MultiSource/Applications/sqlite3/sqlite3.c
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D87034/new/
https://reviews.llvm.org/D87034
More information about the llvm-commits
mailing list