[AAPointerInfo] refactor how offsets and Access objects are tracked
This restores commit b756096b, which was originally reverted in 00b09a7b. AAPointerInfo now maintains a list of all Access objects that it owns, along with the following maps: - OffsetBins: OffsetAndSize -> { Access } - InstTupleMap: RemoteI x LocalI -> Access A RemoteI is any instruction that accesses memory. RemoteI is different from LocalI if and only if LocalI is a call; then RemoteI is some instruction in the callgraph starting from LocalI. Motivation: When AAPointerInfo recomputes the offset for an instruction, it sets the value to Unknown if the new offset is not the same as the old offset. The instruction must now be moved from its current bin to the bin corresponding to the new offset. This happens for example, when: - A PHINode has operands that result in different offsets. - The same remote inst is reachable from the same local inst via different paths in the callgraph: ``` A (local inst) | B / \ C1 C2 \ / D (remote inst) ``` This fixes a bug where a store is incorrectly eliminated in a lit test. Reviewed By: jdoerfert, ye-luo Differential Revision: https://reviews.llvm.org/D136526
Loading
Please sign in to comment