[PATCH] D81811: [ValueLattice] Allocate value lattice elements on a pool (WIP)

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 14 11:45:00 PDT 2020


nikic created this revision.
nikic added a reviewer: fhahn.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.

This introduces a uniqued, bump-pointer allocated pool of value lattice elements. `ValueLatticeElement` is still used directly for some temporaries, but the persisted values are fetched from the pool and represented as `const ValueLatticeElement *`.

I think this has a couple of advantages:

- This should use less memory, as each distinct value lattice element is only stored once.
- As a consequence, LVI no longer needs to store overdefined values separately, as storing everything directly is now cheap.
- SCCP will no longer have to worry about invalidating references to value lattice elements.

This patch only has the LVI portion of the change (and there's probably some optimization potential there). For SCCP the main extra thing to handle would be the NumRangeExtensions, which would have to be moved into a separate value->int map under this model.

Preliminary compile-time numbers are a small improvement: https://llvm-compile-time-tracker.com/compare.php?from=862db369f8a8c543735c475ed05cf512846c3868&to=4388725f333c69cf29724528405038f8e143e579&stat=instructions


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D81811

Files:
  llvm/include/llvm/Analysis/ValueLattice.h
  llvm/lib/Analysis/LazyValueInfo.cpp
  llvm/lib/Analysis/ValueLattice.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D81811.270629.patch
Type: text/x-patch
Size: 34969 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200614/3bc9c197/attachment.bin>


More information about the llvm-commits mailing list