[AAPointerInfo] handle multiple offsets in PHI
authorSameer Sahasrabuddhe <sameer.sahasrabuddhe@amd.com>
Sun, 18 Dec 2022 05:21:20 +0000 (10:51 +0530)
committerSameer Sahasrabuddhe <sameer.sahasrabuddhe@amd.com>
Sun, 18 Dec 2022 05:21:20 +0000 (10:51 +0530)
commit9c1b82599dac63816cbed80270aaec85a6fa153b
tree3861e964b7619104bca923da255a78d4cb841efe
parent7d4f70f8e598a41a4b673294de84ef3ee1cb333e
[AAPointerInfo] handle multiple offsets in PHI

Previously reverted in 8b446ea2ba39e406bcf940ea35d6efb4bb9afe95

Reapplying because this commit is NOT DEPENDENT on the reverted commit
fc21f2d7bae2e0be630470cc7ca9323ed5859892, which broke the ASAN buildbot.
See https://reviews.llvm.org/rGfc21f2d7bae2e0be630470cc7ca9323ed5859892 for
more information.

The arguments to a PHI may represent a recurrence by eventually using the output
of the PHI itself. This is now handled by checking for cycles in the control
flow. If a PHI is not in a recurrence, it is now able to report multiple offsets
instead of conservatively reporting unknown.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D138991
llvm/include/llvm/Analysis/CycleAnalysis.h
llvm/include/llvm/Transforms/IPO/Attributor.h
llvm/lib/Target/AMDGPU/AMDGPUAttributor.cpp
llvm/lib/Transforms/IPO/AttributorAttributes.cpp
llvm/test/CodeGen/AMDGPU/implicitarg-attributes.ll
llvm/test/CodeGen/AMDGPU/llc-pipeline.ll
llvm/test/Transforms/Attributor/multiple-offsets-pointer-info.ll