HomePhabricator

[Attributor] Introduce AAPointerInfo

Authored by jdoerfert on Jul 11 2021, 5:27 PM.

Description

[Attributor] Introduce AAPointerInfo

This patch introduces AAPointerInfo which tracks the uses of a pointer
and places them in "bins" based on their offset from the base and access
size.

As with other AAs, any pointer can be tracked but it is up to the user
to make sense of the results. The user in this patch is AAValueSimplify
and AAPotentialValues which both utilize AAPointerInfo to determine the
value of a load. For now, this is restricted to loads of allocas and
internal globals. Through the use of AAPointerInfo and the "bins" we can
track struct members separately. The users also know that storing only
zeros (at unknown indices) will result in loading only 0 (from unknown
indices). Other than that, the users are flow and context insensitive
(for now).

To deal with the "bins" more easily, AAPointerInfo provides a
forallInterfearingAccesses that applies a callback on all accesses
that might interfere with a given load or store.

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

Details

Committed
jdoerfertJul 19 2021, 8:48 PM
Differential Revision
D104432: [Attributor] Introduce AAPointerInfo
Parents
rG28c78a9e126d: [Attributor] Simplify loads
Branches
Unknown
Tags
Unknown