[PATCH] D20116: Add nosideeffects function attribute
Hal Finkel via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 13 14:17:31 PDT 2016
hfinkel added a subscriber: hfinkel.
================
Comment at: docs/LangRef.rst:1404
@@ +1403,3 @@
+ This function attribute indicates that the function does not modify any
+ state that isn't accessbile from the IR (e.g. floating-point exception
+ registers). Functions with the nosideeffects attribute can be safely
----------------
arsenm wrote:
> mehdi_amini wrote:
> > tstellarAMD wrote:
> > > With my original definition, I was trying to match what we already have in the .td files for intrinsics. I've updated the definition in this patch to be:
> > >
> > > > nosideeffects tells the optimizer that the function does not modify any
> > > > state that isn't accessible from the IR (e.g. floating-point exception
> > > > registers).
> > >
> > > I'm not sure if this is what you were thinking, but hopefully this gives us a better starting point for discussion.
> > >
> > >
> > >
> > Typo `accessbile`
> >
> > Also it isn't clear how it interacts with memory. Are we only considering "non-memory" effects with this attribute? What are the side effects we want to track and what will they be used for?
> > Is it just about "this won't not trap or exit"?
> I kind of think it should be renamed speculatable, since the intention is any kind of operation that would prevent speculating
I agree. This is really the "safe to speculatively execute" attribute.
http://reviews.llvm.org/D20116
More information about the llvm-commits
mailing list