[PATCH] D69914: [LVI] Normalize pointer behavior

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 20 04:12:16 PDT 2020


nikic updated this revision to Diff 272250.
nikic added a comment.

Rebase.

Unfortunately I found that the compile-time impact of this change is a bit hit and miss: https://llvm-compile-time-tracker.com/compare.php?from=f87b785abee0da8939fdd5900a982311b4c25409&to=f3490beadb768e921e531fd61450a7c5bfa84f2d&stat=instructions Some benchmarks improve, some regress. The reason is that the new implementation performs only a single scan to find dereferenced pointers, but performs a `GetUnderlyingObject()` call on every query, which is quite expensive. It's probably necessary to cache underlying objects as well.

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.


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

https://reviews.llvm.org/D69914

Files:
  llvm/lib/Analysis/LazyValueInfo.cpp
  llvm/test/Transforms/CorrelatedValuePropagation/non-null.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D69914.272250.patch
Type: text/x-patch
Size: 11034 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200620/356b9729/attachment-0001.bin>


More information about the llvm-commits mailing list