[PATCH] D20116: Add speculatable function attribute

Mehdi AMINI via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 15 08:56:11 PST 2016


mehdi_amini added inline comments.


================
Comment at: docs/LangRef.rst:1521
+    particular exection path the number of calls to this function will not be
+    externally observable.
 ``ssp``
----------------
hfinkel wrote:
> tstellarAMD wrote:
> > mehdi_amini wrote:
> > > "does not have any effects besides calculating its result" and "speculatable is not enough to conclude that [...] the number of calls to this function will not be externally observable." seem contradictory to me.
> > > 
> > > (Also you have a typo with `exection` instead of `execution`)
> > I would like to try to revive this discussion.  We've gone back and forth a lot on the attribute description.   The intention is that speculatable allows something to be speculatively executed, but is not enough by itself to determine whether or not the function can be CSE'd.
> > 
> > Would it make sense to replace:
> >  'does not have any effects besides calculating its result'
> > with
> > 'does not have any effects other than possibly reading/writing memory and calculating its result'
> It also can't have any undefined behavior.
Isn't it enough to say: `This function attribute indicates that the function does not have undefined behavior, for any possible combination of arguments or global memory state.` ?


https://reviews.llvm.org/D20116





More information about the llvm-commits mailing list