[LLVMdev] [RFC] New function attributes for errno-setting functions

Krzysztof Parzyszek kparzysz at codeaurora.org
Tue Sep 17 13:23:14 PDT 2013


On 9/17/2013 2:43 PM, Hal Finkel wrote:
>
> That would depend on how this attribute was used; it could only be used by a pass that did actually understand what those side effects were (like the loop vectorizer understanding that, if errno is ignored, then vectorizing cos() is legal). I don't object to making the name generic, but I want to make sure that we're all on the same page regarding what it means.

In some cases the exact nature of the side effects wouldn't need to be 
known.  For example, if the side-effects are known to be ignored, a call 
to such a function could be eliminated as dead code.


Also, the "errno-ignored" or equivalent attribute brings up this question:
given this code
   x = cos(y);   // assume "errno-ignored"
   z = global;
is it safe to infer that "global" is not errno?  In other words, could 
this attribute be used to refine alias information with respect to errno?

-K


-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, 
hosted by The Linux Foundation



More information about the llvm-dev mailing list