Displaying 2 results from an estimated 2 matches for "yw0n3v".
2015 Mar 08
2
[LLVMdev] A limitation of LLVM with regard to marking sret functions as readonly.
...;
int b;
int c;
};
extern s g(void* env) __attribute__ ((pure));
float func(float x, void* env)
{
return g(env).x + g(env).x;
}
---------------------------------
Then LLVM compiles 'func' to have 2 calls to g, and g is no longer
marked as 'readonly' See http://goo.gl/YW0n3V
So it doesn't seem possible to me to mark an SRET function as readonly.
To me this seems like a problem.
One way to fix this could be to change the semantics of the readonly
attribute - it could be changed to allow writing through the SRET
pointer argument only.
Cheers,
Nick C.
2015 Mar 09
2
[LLVMdev] A limitation of LLVM with regard to marking sret functions as readonly.
...>
>
> float func(float x, void* env)
> {
> return g(env).x + g(env).x;
> }
> ---------------------------------
>
> Then LLVM compiles 'func' to have 2 calls to g, and g is no longer
> marked as 'readonly' See http://goo.gl/YW0n3V
>
> You mean clang does.
> Because it is clang that is turning off the attributes, deliberately
> (CGCall.cpp)
>
>
> So it doesn't seem possible to me to mark an SRET function as
> readonly.
> To me this seems like a problem.
>
>
>
> I agree w...