[PATCH] D104668: [OpaquePtr] Handle addrspacecasts in InstCombine

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 21 15:27:08 PDT 2021


dblaikie added a comment.

In D104668#2831751 <https://reviews.llvm.org/D104668#2831751>, @aeubanks wrote:

> In D104668#2831687 <https://reviews.llvm.org/D104668#2831687>, @nikic wrote:
>
>>> Any thoughts on the approach here? Is the `!isOpaque() ? getElementType() : nullptr ` pattern something we should add a helper function for? Not sure how common this is going to be outside these cast transforms.
>>
>> Or possibly `PointerType::hasSameElementTypeAs(PointerType *)` would make sense here.
>
> I think `PointerType::hasSameElementTypeAs(PointerType *)` is good, we already have weird `PointerType` methods that are only for the opaque pointer transition, like `PointerType::getWithSamePointeeType()`, that aren't used in a lot of places and are to be deleted after.

*thumbs up* I hope these sort of helpers will make the transition a bit easier - they can become no-ops/have their non-opaque parts removed at the appropriate point in the transition, then simple/clear/obvious change to remove the function and have callers do the right thing in a cleanup/NFC change.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D104668/new/

https://reviews.llvm.org/D104668



More information about the llvm-commits mailing list