[PATCH] D90341: Use deref facts derived from minimum object size of allocations

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 28 14:02:18 PDT 2020


reames created this revision.
reames added reviewers: jdoerfert, fhahn, nikic.
Herald added subscribers: dantrushin, bollu, hiraditya, mcrosier.
Herald added a project: LLVM.
reames requested review of this revision.

This change should be fairly straight forward.  If we've reached a call, check to see if we can tell the result is dereferenceable from information about the minimum object size returned by the call.

To control compile time impact, I'm only adding the call for base facts in the routine.  getObjectSize can also do recursive reasoning, and we don't want that general capability here.

As a follow up patch (without separate review), I will plumb through the missing TLI parameter.  That will have the effect of extending this to known libcalls - malloc, new, and the like - whereas currently this only covers calls with the explicit allocsize attribute.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D90341

Files:
  llvm/lib/Analysis/Loads.cpp
  llvm/test/Transforms/LoopVectorize/X86/load-deref-pred.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D90341.301421.patch
Type: text/x-patch
Size: 38667 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201028/90bf95a4/attachment.bin>


More information about the llvm-commits mailing list