[GlobalOpt] Fix dead const handling in pointer root user cleanup (PR61674)
authorNikita Popov <npopov@redhat.com>
Fri, 24 Mar 2023 13:17:26 +0000 (14:17 +0100)
committerNikita Popov <npopov@redhat.com>
Fri, 24 Mar 2023 13:19:43 +0000 (14:19 +0100)
commit84717a78a3482a4d969c3e4fd9196f86a6870c7d
treea75f5bda11acb41ffda08ec0c4c74940982deedd
parentcde1c3c014374233b38728c15f6e766359d52b14
[GlobalOpt] Fix dead const handling in pointer root user cleanup (PR61674)

Rather than cleanup up dead constant expressions as we go along,
do this once at the end. This aligns it with the
CleanupConstantGlobalUsers() implementation and avoids
any invalidation issues.

Fixes https://github.com/llvm/llvm-project/issues/61674.
llvm/lib/Transforms/IPO/GlobalOpt.cpp
llvm/test/Transforms/GlobalOpt/pr61674.ll [new file with mode: 0644]