[PATCH] D20116: Add speculatable function attribute

Tom Stellard via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 15 05:08:12 PST 2016


tstellarAMD marked an inline comment as done.
tstellarAMD 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``
----------------
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'


https://reviews.llvm.org/D20116





More information about the llvm-commits mailing list