[PATCH] D20116: Add speculatable function attribute

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 27 16:16:57 PDT 2017


arsenm added a comment.

In https://reviews.llvm.org/D20116#711697, @sanjoy wrote:

> In https://reviews.llvm.org/D20116#711367, @arsenm wrote:
>
> > In https://reviews.llvm.org/D20116#710866, @nlopes wrote:
> >
> > > In the ideal world, predicates wouldn't overlap, although since we can only state ANDs of predicates and not ORs, some overlap may be need in practice.
> >
> >
> > It behaves as an or right now? Last time I checked the implementation, call sites just scan its attributes and then check the set on the declaration
>
>
> That behavior precisely means it is an AND -- a call site marked as `readonly nounwind` is both `readonly` AND `nounwind`.
>
> One concrete example illustrating Nuno's point is the `dereferenceable_or_null` attribute.  If we had an `is_null` attribute (or emulated it via `!range`), then we would not need a new attribute to denote that a value is //either// dereferenceable //or// null.


OK, I was thinking about it like: Is this call readnone? It is if if the call site OR the declaration is readnone.


https://reviews.llvm.org/D20116





More information about the llvm-commits mailing list