HomePhabricator

[InferAddressSpaces] Handle the pair of `ptrtoint`/`inttoptr`.

Authored by hliao on Jun 15 2020, 9:08 PM.

Description

[InferAddressSpaces] Handle the pair of ptrtoint/inttoptr.

Summary:

  • ptrtoint and inttoptr are defined as no-op casts if the integer value as the same size as the pointer value. The pair of ptrtoint/inttoptr is in fact a no-op cast sequence between different address spaces. Teach infer-address-spaces to handle them like a bitcast.

Reviewers: arsenm, chandlerc

Subscribers: jvesely, wdng, nhaehnle, hiraditya, kerbowa, cfe-commits, llvm-commits

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D81938

Details