[PATCH] D76788: [LVI] Cleanup/unify cache access

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 25 11:21:13 PDT 2020


nikic created this revision.
nikic added reviewers: reames, lebedev.ri.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This patch combines the "has" and "get" parts of the cache access. `getCachedValueInfo()` now both sets the `BBLV` return argument, and returns whether the value was found.

Additionally, the management of the work stack is now integrated into `getBlockValue()`. If the value is not cached yet, we try to push to the stack (and return false, indicating that we need to solve first), or return overdefined in case of a cycle.

These changes a) avoid a duplicate cache lookup for has & get and b) ensure that the logic is uniform everywhere. For this reason this change is also not quite NFC, because previously overdefined values from the cache, and overdefined values from a cycle received slightly different treatment in some places.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D76788

Files:
  lib/Analysis/LazyValueInfo.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D76788.252625.patch
Type: text/x-patch
Size: 8791 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200325/67cc7c65/attachment.bin>


More information about the llvm-commits mailing list