[PATCH] D69914: [LVI] Normalize pointer behavior

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 22 07:30:14 PDT 2020


fhahn added a comment.

In D69914#2105255 <https://reviews.llvm.org/D69914#2105255>, @nikic wrote:

> Furthermore this change seems to have a larger impact on optimization than I expected, with larger code-size changes for some benchmarks: https://llvm-compile-time-tracker.com/compare.php?from=f87b785abee0da8939fdd5900a982311b4c25409&to=f3490beadb768e921e531fd61450a7c5bfa84f2d&stat=size-text Apparently being able to eliminate a null branch at the end of the block where the pointer is dereferenced is quite valuable.


Interesting! I am wondering if it might be worth to handle simplifications based on dereferenceability in a separate pass, rather than making the caching more complicated. I am not sure how much benefit we get from other places in LVI knowing that a ptr is not null, but I would expect it not too be too much.

I've put up a simple prototype that just keeps track of dereferenced objects based on dominance D82299 <https://reviews.llvm.org/D82299> and eliminates null checks in a single traversal of a sorted list of dereferences/compares.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D69914/new/

https://reviews.llvm.org/D69914





More information about the llvm-commits mailing list