[PATCH] D29164: NVPTX: Refactor NVPTXInferAddressSpaces to check TTI

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 30 13:24:11 PST 2017

arsenm added a comment.

In https://reviews.llvm.org/D29164#660049, @jlebar wrote:

> > I fixed the name of ADDRESS_SPACE_UNINITIALIZED to be UnknownAddressSpace in the cleanup commit which I think is more clear. I'd rather not deviate from the API/convention the other address space TTI functions already use (e.g. LSR defines the same constant and passes it to isLegalAddressingMode sometimes)
> The documentation as written doesn't ever say that we return -1 if the target doesn't have a flat AS.  In fact it's not even explicit whether all targets have a valid "flat" AS -- maybe we just return 0 for "normal" targets.

Then the pass will run and do something nonsensical. I think this would break people using addrspacecast for GC etc.


More information about the llvm-commits mailing list