[llvm] [InferAS] Infer the address space of inttoptr (PR #173244)
Luo Yuanke via llvm-commits
llvm-commits at lists.llvm.org
Sun Jan 11 04:45:22 PST 2026
LuoYuanke wrote:
> Is it possible to replace the ptrtoint + arithmetic + inttoptr with ptradd(p, new_p - p)?
For some arithmetic operations (.e.g., add/sub) I think it is possible. `InstCombinerImpl::visitIntToPtr` performs some optimization for certain patterns to eliminate ptrtoint/inttoptr. But it may not work for mul/div/rem and logic operations.
https://github.com/llvm/llvm-project/pull/173244
More information about the llvm-commits
mailing list