<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/73510>73510</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            How can I get precise pointee type and what is Address is for?
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          ash1852
      </td>
    </tr>
</table>

<pre>
    I'm using llvm to implement some tranformation on IR, so there are some creation for AllocInst. If I create a AllocInst with element type **A**, I thought the type of created AllocInst should be pointer type of **A**, but it was not. The created AllocInst's type is a pointer type but its pointee type is null thus causing null dereference.
![image](https://github.com/llvm/llvm-project/assets/87304478/282db3b9-459a-4df7-af58-a8d2ddf2c668)
and after check the source code, i found the type of the AllocInst is set by using **PointerType \*PointerType::get(Type \*EltTy, unsigned AddressSpace)**
![image](https://github.com/llvm/llvm-project/assets/87304478/dbc8ca88-27ec-4129-8d06-c869beebe1bf)
since AddressSpace==0, CImpl->PointerTypes[EltTy] was returned.
I've search for what AddressSpace is for but still did'nt get it. Can you explain it Or just help me to get a precise pointee type of pointer type?
thank you very much.


</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy0VMuO4zYQ_Br60pAhUe-DDp7xGvEpQTI_QJEtkbsUKfAxjv8-oOSdGWNzySEXUWA3qrurqsm8V7NBHEj9QurzgcUgrRuYl0VX08NoxX24EtouEL0yM2j9vkCwoJZV44ImgLcLQnDMTNYtLChrwBq4_knoK3gLQaJDYA73RO5wz5msg5PWll-ND0e4TnDdgwjsMwA3FSTgo1S4rwiEngg9nfYjFblCkDbOMqRae46dHljiC5SXNmoBI8JqlQnoPnJ_gRxjABXgxjwYG47wJvFXQEJbv0MoD-wZdAfwj0v8SDNRawgyeuBsJ3S7EehwQoeG45HkZ5KfCC1I_aIWNiOpz4R2MoTVk_JE6IXQy6yCjOOR24XQS9LkcWSrs9-RB0IvzHsMntBL15Z5VbUdoRfaUTGWY59Vdc-ySkxtxqa6y1gnqBAT5U3TEdrvLTAjgE1pJC6R_9jY9TY6jsCtwMSTgslGI56IT_-fpCsPHgOM94d_do7_2Ll62_SsX59v0pDlacZAaPcl45sOb_dUNJrNsgJOQjj0_q-VcUxd7_L9j_SJkXecdV1GW-RZVdA-60TeZLxr-hFxxGKcPujzynB87rE8k_Kcpxler8uqM1J--zK3J_XLPmR93qznMERnUDwskdbwHcEjc1xu-3OTLDxVSHSnQLKfDyo5SwlCWxNgxuTII7wyA3cbAf9eNVMm2fx3B9-jDyBRr5CW2W7ZDFaHXHl8drGdnqxOysveXpDM_Nig39HdYYlc_vTy9j2IoRR92bMDDkWbF3mfV0V-kIPglGLVd13Z1DzHphdNwXpeNnzkfdHQgxpoTsuioG1R5k2dH0WRT23ft60ox7bhBalyXJjSx6Th0br5oLyPOLRlXeQHzUbUfnvgKDV4gy1IKE3vnRs23cc4e1LlWvngP1GCChqH3-wNODNw3Vj5V07SqmxiKP9Tj4cUpLwcotPDf_bf1mTy3zbEPwEAAP__unjWIw">