aboutsummaryrefslogtreecommitdiff
path: root/clang/test/CodeGen/call-graph-section-virtual-methods.cpp
diff options
context:
space:
mode:
authorNikita Popov <npopov@redhat.com>2025-10-23 11:57:24 +0200
committerGitHub <noreply@github.com>2025-10-23 11:57:24 +0200
commitf801b6f67ea896d6e4d2de38bce9a79689ceb254 (patch)
tree6764eadb3145f34f7136b213f92090fa985acd65 /clang/test/CodeGen/call-graph-section-virtual-methods.cpp
parent710a5873fbf43d312555a1ddbafafa10f44f576e (diff)
downloadllvm-f801b6f67ea896d6e4d2de38bce9a79689ceb254.zip
llvm-f801b6f67ea896d6e4d2de38bce9a79689ceb254.tar.gz
llvm-f801b6f67ea896d6e4d2de38bce9a79689ceb254.tar.bz2
[InstCombine] Add support for ptrtoaddr in pointer difference folds (#164428)
This adds support for folding `ptrtoaddr(p2) - ptrtoaddr(p)` pointer subtractions. We can treat ptrtoaddr the same as ptrtoint as the transform is truncation safe anyway (and in fact supports explicit truncation as well). The only interesting case is the subtraction of zext of ptrtoaddr. For this transform it's important that the address bits are not truncated -- and if any pointer bits are truncated, that the truncation is consistent for both operands. I've explicitly spelled out the three different cases for this, which also fixes a miscompile in the existing ptrtoint fold.
Diffstat (limited to 'clang/test/CodeGen/call-graph-section-virtual-methods.cpp')
0 files changed, 0 insertions, 0 deletions