[PATCH] [InstCombine] Canonicalize addrspacecast between different element types

Rafael EspĂ­ndola rafael.espindola at gmail.com
Thu Jun 5 14:22:23 PDT 2014


On 5 June 2014 17:01, Jingyue Wu <jingyue at google.com> wrote:
> Hi Phillip,
>
> Thanks for your comments! They do make a lot of sense.
>
> I wasn't here when the addrspacecast instruction was added. Maybe Matt can
> provide more context on why addrspacecast is a superset of bitcast. However,
> I don't see too much value of including the semantics of bitcast besides
> making bitcode more compact.
>
> With that, I would be more than happy to work on having clang emitting both
> of them. But even with changes in clang, I think instcombine would still
> need this canonicalization to handle IR not directly generated by clang.

If desirable, we could change the IR to require addrspacecast to
change just the address space and then move this logic to the bitcode
upgrade.

Cheers,
Rafael



More information about the llvm-commits mailing list