[PATCH] D47891: [InstSimplify] shl nuw %x, %y -> %x iff KnownBits says %x is negative.

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 7 15:20:07 PDT 2018


spatel added a comment.

In https://reviews.llvm.org/D47891#1125460, @lebedev.ri wrote:

> Ok, got the self-hosting stats.
>
>   $ find -iname *.stats | wc -l
>   3049
>   $ find -iname *.stats | xargs grep NumShlNuwNonConstF
>   ./lib/Analysis/CMakeFiles/LLVMAnalysis.dir/LoopInfo.stats:      "instsimplify.NumShlNuwNonConstFolded": 1,
>   ./unittests/ADT/CMakeFiles/ADTTests.dir/PriorityWorklistTest.stats:     "instsimplify.NumShlNuwNonConstFolded": 1,
>
>
> So counter2, times the fold happened is `2`.
>
> I haven't found where is the tooling to process these `.stats` dumps, so i have manually processed it for the `"instsimplify.NumShlNuwNonConst"` entries.
>  The counter1, the times we called `computeKnownBits()` here is `643566`.


Thanks for collecting the stats. I also don't know where the tooling for processing stats lives. I did some similar grep last time I wanted to find something like this.

> I'm guessing it means we don't want this :)

Yes, that seems like a very small probability of success, but I really don't know where we set the threshold for cost/benefit. If someone finds this hole in real code, we can revisit.


Repository:
  rL LLVM

https://reviews.llvm.org/D47891





More information about the llvm-commits mailing list