[PATCH] D20116: Add speculatable function attribute

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 22 16:18:37 PDT 2017


arsenm added a comment.

In https://reviews.llvm.org/D20116#708174, @mehdi_amini wrote:

> In https://reviews.llvm.org/D20116#708109, @hfinkel wrote:
>
> > In https://reviews.llvm.org/D20116#708076, @mehdi_amini wrote:
> >
> > > That troubles (and worries) me as well.
> >
> >
> > Why?
>
>
> Irrational fear? ;-)
>  It seems unusual, and I'm cautious about introducing unusual properties in the compiler in general, it makes it harder to reason about "stuff" when there aren't "simple" rules to guide the logic.
>  Are there existing other cases of UB induced by unreachable/dead code?


I suppose it's the same as speculating a load from a pointer marked as dereferencable that isn't really, which is already done


https://reviews.llvm.org/D20116





More information about the llvm-commits mailing list