[AAPointerInfo] OffsetInfo: Unassigned is distinct from Unknown
authorSameer Sahasrabuddhe <sameer.sahasrabuddhe@amd.com>
Tue, 27 Sep 2022 05:19:56 +0000 (10:49 +0530)
committerSameer Sahasrabuddhe <sameer.sahasrabuddhe@amd.com>
Wed, 28 Sep 2022 15:01:36 +0000 (20:31 +0530)
commit3f078b308bc67d3a05dc0de2588790ed9669febc
tree8c80ed2b2d84e85f1691bfd796f754acd0857eb0
parent0fb2676c248ef1b76a4ef86c934e69ff80796ba7
[AAPointerInfo] OffsetInfo: Unassigned is distinct from Unknown

A User like the PHINode may be visited multiple times for the same pointer along
different def-use edges. The uninitialized state of OffsetInfo at the first
visit needs to be distinct from the Unknown value that may be assigned after
processing the PHINode. Without that, a PHINode with all inputs Unknown is never
followed to its uses. This results in incorrect optimization because some
interfering accessess are missed.

Differential Revision: https://reviews.llvm.org/D134704
llvm/include/llvm/Transforms/IPO/Attributor.h
llvm/lib/Transforms/IPO/AttributorAttributes.cpp
llvm/test/CodeGen/AMDGPU/attributor.ll [new file with mode: 0644]
llvm/test/Transforms/Attributor/value-simplify-pointer-info.ll