[PATCH] D101045: [IR][Verifier] Targets can specify multiple alloca address spaces

Andy Wingo via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 17 01:06:23 PDT 2021


wingo added a comment.

In D101045#2755666 <https://reviews.llvm.org/D101045#2755666>, @arsenm wrote:

> In D101045#2718774 <https://reviews.llvm.org/D101045#2718774>, @wingo wrote:
>
>> In D101045#2711957 <https://reviews.llvm.org/D101045#2711957>, @arsenm wrote:
>>
>>> It hadn't occurred to me to add a field to the datalayout purely for the verifier. That seems a bit strange, since it's not exactly a target property.
>>
>> Yeah understood.  If we want some targets to have the check and some to not have the check, do you know of a better place to express this?  I thought the same place that the target's alloca address space is defined might not be unreasonable, but I am new here :)
>
> I think we should have target specific IR verifiers, not pollute the datalayout. There are a number of other places such a verifier would be useful

Sure but this would be a much larger design effort.  As I see it I have three options right now:

1. Remove the restriction imposed on alloca with an explicitly specified address space
2. Keep the restriction but allow datalayout to specify multiple valid alloca address spaces (this patch)
3. Add a target-specific IR verifier somehow.  It couldn't extend Verifier because Verifier is private; would have to be a separate pass.  However surely in this case we'd remove the restriction on alloca address spaces in the core verifier.

I am leaning back towards (1), wdyt @arsenm ?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D101045



More information about the llvm-commits mailing list