similar to: [LLVMdev] constand folding of functions

Displaying 20 results from an estimated 7000 matches similar to: "[LLVMdev] constand folding of functions"

2010 Mar 03
0
[LLVMdev] folding x * 0 = 0
On 3 March 2010 11:56, Jochen Wilhelmy <j.wilhelmy at arcor.de> wrote: > > the sin and cos calls are folded, but not the mul by zero. > Is x*0 => 0 true if isnan(x)? And cos(x)*sin(x) makes me desperately want to fold it to sin(2*x)/2, but I suppose that's not allowed either.
2010 Mar 03
5
[LLVMdev] folding x * 0 = 0
Hi! > sin/cos etc should already be handled by lib/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
2012 Mar 02
0
[LLVMdev] replace hardcoded function names by intrinsics
On Fri, 02 Mar 2012 13:55:18 +0100 Jochen Wilhelmy <jochen.wilhelmy at googlemail.com> wrote: > Hi! > > in the llvm code there are several places with hardcoded function > names for e.g. sin, sinf, sqrt, sqrtf etc., namely > ConstantFolding.cpp > InlineCost.cpp > SelectionDAGBuilder.cpp > IntrinsicLowering.cpp > TargetLowering.cpp > > my question is:
2012 Mar 02
4
[LLVMdev] replace hardcoded function names by intrinsics
Hi! in the llvm code there are several places with hardcoded function names for e.g. sin, sinf, sqrt, sqrtf etc., namely ConstantFolding.cpp InlineCost.cpp SelectionDAGBuilder.cpp IntrinsicLowering.cpp TargetLowering.cpp my question is: wouldn't it be beneficial to use intrinsics for this? for example a c/c++ frontend (clang) could translate the function calls to intrinsics and then in a
2010 Mar 05
0
[LLVMdev] folding x * 0 = 0
Hi Jochen, I just wanted to point out that if x = inf the result of x * 0 is in indeterminate form so reducing it to zero would give the wrong result in that case. Thanks, Javier On 3/3/2010 8:56 AM, Jochen Wilhelmy wrote: > Hi! > > > >> sin/cos etc should already be handled by lib/Analysis/ConstantFolding.cpp. >> >> > Thanks for the hint and it
2013 Jan 22
2
[LLVMdev] sincos optimization
Hi, I'm looking at http://llvm.org/bugs/show_bug.cgi?id=13204 which involves converting calls to sin and cos to sincos (when available) Initially I thought about transforming calls to sinf/cosf to sincosf. However, I don't think this is a legal transformation given that a declaration for a function called sinf is not necessarily the standard library function. Therefore it makes sense to
2013 Jan 22
0
[LLVMdev] sincos optimization
On 22/01/13 05:30, Redmond, Paul wrote: [...] > I'm looking at http://llvm.org/bugs/show_bug.cgi?id=13204 which involves converting calls to sin and cos to sincos (when available) > > Initially I thought about transforming calls to sinf/cosf to sincosf. However, I don't think this is a legal transformation given that a declaration for a function called sinf is not necessarily the
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
2011 Dec 29
0
[LLVMdev] InstCombine "pessimizes" trunc i8 to i1?
I think Chris is saying that the and is necessary because with your i1 trunc you're ignoring all of the high bits. The and implements that. If you don't want this behavior, don't generate the trunc in the first place and just compare the full width to zero. Reid On Wed, Dec 28, 2011 at 6:45 AM, Jochen Wilhelmy <j.wilhelmy at arcor.de>wrote: > > >> Hi! >
2010 Mar 03
3
[LLVMdev] folding x * 0 = 0
> I'm not sure how that would work, but it most likely wouldn't fit with the design of llvm. If this is important, I'd rather fix the representational issue. > > Just #ifdef RELAXED_FLOAT here the code like I posted #endif what do you mean by the representational issue? something in the IR? Perhaps something like the value tracking can be implemented that tracks if a
2010 Nov 26
3
[LLVMdev] request for windows unicode support
On 25.11.2010 23:56, Michael Spencer wrote: > On Nov 25, 2010, at 5:01 PM, Jochen Wilhelmy <j.wilhelmy at arcor.de > <mailto:j.wilhelmy at arcor.de>> wrote: > >> Hi! >> >> Of course nobody wants to implement unicode support for windows >> because windows should support an utf8-locale and windows is obsolete >> anyway ;-) >> >> But
2010 Mar 03
2
[LLVMdev] folding x * 0 = 0
> Is x*0 => 0 true if isnan(x)? > then where do I have to add it if I want to make it a non-standard modification of my local llvm version? would it make sense to add a subset of float to llvm or a kind of modifier (e.g. valid float to indicate that it is always valid and not nan) to allow more aggressive optimization? just like e.g. inbounds for load -Jochen
2010 Mar 03
2
[LLVMdev] folding x * 0 = 0
> You should check out the -enable-finite-only-fp-math and -enable-unsafe-fp-math options. Good hint, but llvm::UnsafeFPMath = true; llvm::FiniteOnlyFPMathOption = true; at the beginning of my code does not help. I found llvm::Reassociate::OptimizeExpression in llvm\lib\Transforms\Scalar\Reassociate.cpp which looks like it does X * 0 = 0 for int, but it does not get called for
2010 Mar 03
0
[LLVMdev] folding x * 0 = 0
On Mar 3, 2010, at 12:41 PM, Jochen Wilhelmy wrote: > >> I'm not sure how that would work, but it most likely wouldn't fit with the design of llvm. If this is important, I'd rather fix the representational issue. >> >> > Just > #ifdef RELAXED_FLOAT > here the code like I posted > #endif Ok, that's what I thought, we don't want that in
2010 Nov 25
0
[LLVMdev] request for windows unicode support
On Nov 25, 2010, at 5:01 PM, Jochen Wilhelmy <j.wilhelmy at arcor.de> wrote: > Hi! > > Of course nobody wants to implement unicode support for windows > because windows should support an utf8-locale and windows is obsolete > anyway ;-) > > But there is a simple solution: use boost::filesystem::path everywhere you > use file names and paths, for example in
2010 Mar 03
3
[LLVMdev] folding x * 0 = 0
> These flags only affect the code generator. If you want to add this optimization to your copy of llvm, you can do so by adding it to the instcombine pass. We'd need IR enhancements to do this sort of thing for real in the mid-level optimizer, some thoughts are here: > http://nondot.org/sabre/LLVMNotes/FloatingPointChanges.txt > Thanks, now it works. I inserted if
2010 Mar 03
0
[LLVMdev] folding x * 0 = 0
On Mar 3, 2010, at 9:32 AM, Jochen Wilhelmy wrote: > >> Is x*0 => 0 true if isnan(x)? >> > then where do I have to add it if I want to make it a non-standard > modification > of my local llvm version? > would it make sense to add a subset of float to llvm or a kind of modifier > (e.g. valid float to indicate that it is always valid and not nan) to > allow
2010 Mar 03
0
[LLVMdev] folding x * 0 = 0
On Mar 3, 2010, at 10:23 AM, Jochen Wilhelmy wrote: > >> You should check out the -enable-finite-only-fp-math and -enable-unsafe-fp-math options. > > Good hint, but > > llvm::UnsafeFPMath = true; > llvm::FiniteOnlyFPMathOption = true; > > at the beginning of my code does not help. > I found llvm::Reassociate::OptimizeExpression in >
2010 Mar 03
0
[LLVMdev] folding x * 0 = 0
On Mar 3, 2010, at 11:07 AM, Jochen Wilhelmy wrote: > >> These flags only affect the code generator. If you want to add this optimization to your copy of llvm, you can do so by adding it to the instcombine pass. We'd need IR enhancements to do this sort of thing for real in the mid-level optimizer, some thoughts are here: >>