Displaying 4 results from an estimated 4 matches for "_zst3cosf".
2010 Mar 03
5
[LLVMdev] folding x * 0 = 0
.../Analysis/ConstantFolding.cpp.
>
Thanks for the hint and it works!
Now I have a new Problem:
I have this function:
float foo(float a, float b)
{
float x = a * b * 0.0f;
return cos(0.5) * sin(0.5) * x;
};
after compiling it with clang (cpp mode) and renaming _ZSt3sinf to sin
and _ZSt3cosf to cos I get the following:
define float @_Z3fooff(float %a, float %b) nounwind {
entry:
%mul = fmul float %a, %b ; <float> [#uses=1]
%mul2 = fmul float %mul, 0.000000e+000 ; <float> [#uses=1]
%mul6 = fmul float 0x3FDAED54A0000000, %mul2 ; &l...
2010 Mar 01
2
[LLVMdev] constant folding for standard math functions
Hi!
I'd like to replace all calls to standard math functions (e.g. sin(0.5)) by
their result.
What strategy do you recommend?
Should I write a pass that does only this or should I copy and
modify the SCCP pass?
A problem with an extra pass could be that that I need to alternate
my pass and SCCP several times since the results of the math functions
could be folded again.
-Jochen
2010 Mar 01
0
[LLVMdev] constant folding for standard math functions
On Mar 1, 2010, at 9:44 AM, Jochen Wilhelmy wrote:
> Hi!
>
> I'd like to replace all calls to standard math functions (e.g. sin(0.5)) by
> their result.
> What strategy do you recommend?
> Should I write a pass that does only this or should I copy and
> modify the SCCP pass?
>
> A problem with an extra pass could be that that I need to alternate
> my pass and
2010 Mar 05
0
[LLVMdev] folding x * 0 = 0
...t and it works!
> Now I have a new Problem:
>
> I have this function:
>
> float foo(float a, float b)
> {
> float x = a * b * 0.0f;
> return cos(0.5) * sin(0.5) * x;
> };
>
> after compiling it with clang (cpp mode) and renaming _ZSt3sinf to sin
> and _ZSt3cosf to cos I get the following:
>
> define float @_Z3fooff(float %a, float %b) nounwind {
> entry:
> %mul = fmul float %a, %b ;<float> [#uses=1]
> %mul2 = fmul float %mul, 0.000000e+000 ;<float> [#uses=1]
> %mul6 = fmul float 0...