aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/Loads.cpp
diff options
context:
space:
mode:
authorNikita Popov <npopov@redhat.com>2025-10-09 10:58:17 +0200
committerNikita Popov <npopov@redhat.com>2025-10-09 10:59:16 +0200
commit4030b276f7e59b66caa483ed4cecf05729611c3c (patch)
treeec4f0cd5132b42a9066bd840ea27667f029ed41c /llvm/lib/Analysis/Loads.cpp
parente43da72b018ccbb175655603865e3b6980bb2b18 (diff)
downloadllvm-4030b276f7e59b66caa483ed4cecf05729611c3c.zip
llvm-4030b276f7e59b66caa483ed4cecf05729611c3c.tar.gz
llvm-4030b276f7e59b66caa483ed4cecf05729611c3c.tar.bz2
[Loads] Handle ptrtoaddr in isPointerUseReplaceable()
Unlike the ptrtoint case, this is actually correct for ptrtoaddr.
Diffstat (limited to 'llvm/lib/Analysis/Loads.cpp')
-rw-r--r--llvm/lib/Analysis/Loads.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/Loads.cpp b/llvm/lib/Analysis/Loads.cpp
index 4c2e1fe..54f55b2 100644
--- a/llvm/lib/Analysis/Loads.cpp
+++ b/llvm/lib/Analysis/Loads.cpp
@@ -812,7 +812,9 @@ static bool isPointerUseReplacable(const Use &U) {
auto *User = Worklist.pop_back_val();
if (!Visited.insert(User).second)
continue;
- if (isa<ICmpInst, PtrToIntInst>(User))
+ // FIXME: The PtrToIntInst case here is not strictly correct, as it
+ // changes which provenance is exposed.
+ if (isa<ICmpInst, PtrToIntInst, PtrToAddrInst>(User))
continue;
if (isa<PHINode, SelectInst>(User))
Worklist.append(User->user_begin(), User->user_end());