[PATCH] D20116: Add speculatable function attribute
Sanjoy Das via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 27 16:00:17 PDT 2017
sanjoy added a comment.
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.
https://reviews.llvm.org/D20116
More information about the llvm-commits
mailing list