[llvm-dev] [RFC] `opt-out` attribute list for intrinsics
Nicolai Hähnle via llvm-dev
llvm-dev at lists.llvm.org
Mon Jun 29 04:35:14 PDT 2020
Hi Stefan,
the TableGen backend could enumerate all records derived from
IntrProperties (globally!) and collect those that have the "isOptOut"
(or perhaps better: "isDefault") value set.
Cheers,
Nicolai
On Wed, Jun 24, 2020 at 11:43 PM Stefan Stipanovic
<stefomeister at gmail.com> wrote:
>
> Hi Nicolai,
>
> Thanks for the reply.
>
> While this sounds reasonable to me, I'm not sure that would work. Right now these properties are bool flags that are initialized per Record and each Record can only see properties from IntrProperties list.
>
> If I'm missing something, please let me know.
>
> Thanks,
> Stefan
>
> On Wed, Jun 24, 2020 at 7:01 PM Nicolai Hähnle <nhaehnle at gmail.com> wrote:
>>
>> Hi Stefan,
>>
>> On Wed, Jun 24, 2020 at 6:30 PM Stefan Stipanovic via llvm-dev
>> <llvm-dev at lists.llvm.org> wrote:
>> > A while back we started annotating intrinsics with new attributes (https://reviews.llvm.org/D65377)
>> >
>> > After some discussion it was decided it would be good to have an `opt-out` attribute list for intrinsics. Some attributes that can be added to the list could be: nosync, nofree, nounwind, willreturn
>> >
>> > For now, there are 2 approaches:
>> >
>> > Filtering opt-out attributes in tablegen source (https://reviews.llvm.org/D70365)
>> > Having tablegen handle opt-out list (https://reviews.llvm.org/D70365?id=229732)
>> >
>> > How do people feel about these approaches? Is any of the two better than the other? Maybe I should consider something else?
>>
>> First of all, thank you for looking into this. I think either approach
>> is fine, but tiven the prevalence of `let IntrProperties` in existing
>> TableGen code, I'd lean slightly towards the approach where
>> reconciling the opt-in and opt-out attributes is done by the TableGen
>> backend.
>>
>> I'd recommend a slightly different tack to implementing that approach
>> though: Add a isOptOut field to the IntrinsicProperty class, and have
>> TableGen automatically determine the default attributes by looking for
>> attributes that have this set to true.
>>
>> Cheers,
>> Nicolai
>>
>>
>> >
>> > Thanks,
>> > Stefan
>> > _______________________________________________
>> > LLVM Developers mailing list
>> > llvm-dev at lists.llvm.org
>> > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>>
>>
>>
>> --
>> Lerne, wie die Welt wirklich ist,
>> aber vergiss niemals, wie sie sein sollte.
--
Lerne, wie die Welt wirklich ist,
aber vergiss niemals, wie sie sein sollte.
More information about the llvm-dev
mailing list