[AAPointerInfo] fix assertion at the pass-through use of a pointer
authorSameer Sahasrabuddhe <sameer.sahasrabuddhe@amd.com>
Tue, 3 Jan 2023 05:55:14 +0000 (11:25 +0530)
committerSameer Sahasrabuddhe <sameer.sahasrabuddhe@amd.com>
Wed, 4 Jan 2023 11:23:55 +0000 (16:53 +0530)
commita73e0c306cdd653e0aa035fc89e91acf771bd318
treed8430793ed8a007a8ef47eba5965836495c48a0d
parent6cac7c285e69f9a3fc96e25453c246d218bd349f
[AAPointerInfo] fix assertion at the pass-through use of a pointer

HandlePassthroughUser may sometimes create a new entry for the OffsetInfo of a
user in the OffsetInfoMap. This can invalidate outstanding references into the
map, including the one which needs to be copied into the new entry. This
produces invalid offset info that can trigger assertions.

Fixed this by not using references at this point. The bug was originally
introduced in commit ID 0dc0a441323d41b4860668f38d290579e0de130c.

Reviewed By: ronlieb

Differential Revision: https://reviews.llvm.org/D140837
llvm/lib/Transforms/IPO/AttributorAttributes.cpp