[PATCH] D87034: [KnownBits] Implement accurate unsigned and signed max and min

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 8 02:39:49 PDT 2020


foad added a comment.

In D87034#2259745 <https://reviews.llvm.org/D87034#2259745>, @nikic wrote:

> Contrary to my expectations, this change had a small but measurable compile-time impact: https://llvm-compile-time-tracker.com/compare.php?from=04ea680a8ccc4f9a4d7333cd712333960348c35b&to=5350e1b5096aa4707aa525baf7398d93b4a4f1a5&stat=instructions
>
> Unfortunately, I have no idea why. I looked at callgrind profiles and the extra instructions (consistently) end up inside a DenseMap method (without changes to number of calls). Can't explain why that would happen, and the diff is not large enough to bother looking further.
>
> I did end up applying this small cleanup while looking over the code again: https://github.com/llvm/llvm-project/commit/ddab4cd83ea31141aaada424dccf94278482ee88

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.

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?


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