OSDN Git Service

[ValueLattice] Use union to shave off ptr size bytes from elements.
authorFlorian Hahn <florian.hahn@arm.com>
Sat, 20 Jan 2018 19:52:16 +0000 (19:52 +0000)
committerFlorian Hahn <florian.hahn@arm.com>
Sat, 20 Jan 2018 19:52:16 +0000 (19:52 +0000)
commit2d05f76ffa9d24a4ac13f46d8cf35db8b795cbef
treeecd34b90d68ac664af1fd3603a467ab3928c9985
parent10fbe29b938b76b617645c9b525531f6a6aa9908
[ValueLattice] Use union to shave off ptr size bytes from elements.

By using a union for Constant* and ConstantRange we can shave off ptr
size bytes off lattice elements. On 64 bit systems, it brings down the
size to 40 bytes from 48 bytes.

Initialization of Range happens on-demand using placement new, if the
state changes to constantrange from non-constantrange. Similarly, the
Range object is destroyed if the state changes from constantrange to
non-constantrange.

Reviewers: reames, anna, davide

Reviewed By: reames, davide

Differential Revision: https://reviews.llvm.org/D41903

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323049 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Analysis/ValueLattice.h