I would like to transform X/Y -> X*1/Y. Specifically, I would like to convert: define void @t1a(double %a, double %b, double %d) { entry: %div = fdiv fast double %a, %d %div1 = fdiv fast double %b, %d %call = tail call i32 @foo(double %div, double %div1) ret void } to: define void @t1b(double %a, double %b, double %d) { entry: %div = fdiv fast double 1.000000e+00, %d %mul = fmul fast double %div, %a %mul1 = fmul fast double %div, %b %call = tail call i32 @foo(double %mul, double %mul1) ret void } Is such a transformation best done as a (target-specific) DAG combine? A similar instcombine already exists for the X/C->X*1/C case (see the CvtFDivConstToReciprocal function in InstCombineMlDivRem.cpp), but I don't believe the above can be done as an instcombine as it creates a new instruction (in addition to replacing the original). Also, I only want to perform the transformation if there are multiple uses of 1/Y (like in my test case). Otherwise, the transformation replaces a fdiv with a fdiv+fmul pair, which I doubt would be profitable. FWIW, I'm also pretty sure this combine requires -fast-math. Can someone point me in the right direction? Thanks, Chad -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130808/6ba77a65/attachment.html>
----- Original Message -----> > I would like to transform X/Y -> X*1/Y. Specifically, I would like to > convert: > > define void @t1a(double %a, double %b, double %d) { > entry: > %div = fdiv fast double %a, %d > %div1 = fdiv fast double %b, %d > %call = tail call i32 @foo(double %div, double %div1) > ret void > } > > to: > > define void @t1b(double %a, double %b, double %d) { > entry: > %div = fdiv fast double 1.000000e+00, %d > %mul = fmul fast double %div, %a > %mul1 = fmul fast double %div, %b > %call = tail call i32 @foo(double %mul, double %mul1) > ret void > } > > Is such a transformation best done as a (target-specific) DAG > combine?Perhaps only partially relevant, but I have a fast-math-only target-specific DAG combine in the PowerPC backend which replaces X/Y -> X*1/Y because we can use the fast reciprocal estimate + newton iteration for 1/Y instead of a full divide. -Hal> > A similar instcombine already exists for the X/C->X*1/C case (see the > CvtFDivConstToReciprocal function in InstCombineMlDivRem.cpp), but I > don't believe the above can be done as an instcombine as it creates > a new instruction (in addition to replacing the original). Also, I > only want to perform the transformation if there are multiple uses > of 1/Y (like in my test case). Otherwise, the transformation > replaces a fdiv with a fdiv+fmul pair, which I doubt would be > profitable. > > FWIW, I'm also pretty sure this combine requires -fast-math. > > Can someone point me in the right direction? > > Thanks, > Chad > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >-- Hal Finkel Assistant Computational Scientist Leadership Computing Facility Argonne National Laboratory
Hi Chad, This is a great transform to do, but you’re right that it’s only safe under fast-math. This is particularly interesting when the original divisor is a constant so you can materialize the reciprocal at compile-time. You’re right that in either case, this optimization should only kick in when there is more than one divide instruction that will be changed to a mul. I don’t have a strong preference for instcombine vs. dagcombine, though I lean slightly towards later when we’ll have more target information available if we want to apply a more complicated cost function for some targets. -Jim On Aug 8, 2013, at 9:25 AM, Chad Rosier <chad.rosier at gmail.com> wrote:> I would like to transform X/Y -> X*1/Y. Specifically, I would like to convert: > > define void @t1a(double %a, double %b, double %d) { > entry: > %div = fdiv fast double %a, %d > %div1 = fdiv fast double %b, %d > %call = tail call i32 @foo(double %div, double %div1) > ret void > } > > to: > > define void @t1b(double %a, double %b, double %d) { > entry: > %div = fdiv fast double 1.000000e+00, %d > %mul = fmul fast double %div, %a > %mul1 = fmul fast double %div, %b > %call = tail call i32 @foo(double %mul, double %mul1) > ret void > } > > Is such a transformation best done as a (target-specific) DAG combine? > > A similar instcombine already exists for the X/C->X*1/C case (see the CvtFDivConstToReciprocal function in InstCombineMlDivRem.cpp), but I don't believe the above can be done as an instcombine as it creates a new instruction (in addition to replacing the original). Also, I only want to perform the transformation if there are multiple uses of 1/Y (like in my test case). Otherwise, the transformation replaces a fdiv with a fdiv+fmul pair, which I doubt would be profitable. > > FWIW, I'm also pretty sure this combine requires -fast-math. > > Can someone point me in the right direction? > > Thanks, > Chad > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130808/4b7d2f8b/attachment.html>
Hi Chad, Instcombine can create new instructions (e.g. some code in combine-select does that). We can do it in DAG as well. (it may be easier to implement in DAG. It will create multiple 1/Y, but later pass should remove the redundancy) Btw, it seems the transformation is beneficial only when %d is used as a common denominator by >2 nominators. Thanks, Weiming From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On Behalf Of Chad Rosier Sent: Thursday, August 08, 2013 9:25 AM To: llvmdev Subject: [LLVMdev] Convert fdiv - X/Y -> X*1/Y I would like to transform X/Y -> X*1/Y. Specifically, I would like to convert: define void @t1a(double %a, double %b, double %d) { entry: %div = fdiv fast double %a, %d %div1 = fdiv fast double %b, %d %call = tail call i32 @foo(double %div, double %div1) ret void } to: define void @t1b(double %a, double %b, double %d) { entry: %div = fdiv fast double 1.000000e+00, %d %mul = fmul fast double %div, %a %mul1 = fmul fast double %div, %b %call = tail call i32 @foo(double %mul, double %mul1) ret void } Is such a transformation best done as a (target-specific) DAG combine? A similar instcombine already exists for the X/C->X*1/C case (see the CvtFDivConstToReciprocal function in InstCombineMlDivRem.cpp), but I don't believe the above can be done as an instcombine as it creates a new instruction (in addition to replacing the original). Also, I only want to perform the transformation if there are multiple uses of 1/Y (like in my test case). Otherwise, the transformation replaces a fdiv with a fdiv+fmul pair, which I doubt would be profitable. FWIW, I'm also pretty sure this combine requires -fast-math. Can someone point me in the right direction? Thanks, Chad -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130808/1e0acc88/attachment.html>
On 08.08.2013, at 18:25, Chad Rosier <chad.rosier at gmail.com> wrote:> I would like to transform X/Y -> X*1/Y. Specifically, I would like to convert: > > define void @t1a(double %a, double %b, double %d) { > entry: > %div = fdiv fast double %a, %d > %div1 = fdiv fast double %b, %d > %call = tail call i32 @foo(double %div, double %div1) > ret void > } > > to: > > define void @t1b(double %a, double %b, double %d) { > entry: > %div = fdiv fast double 1.000000e+00, %d > %mul = fmul fast double %div, %a > %mul1 = fmul fast double %div, %b > %call = tail call i32 @foo(double %mul, double %mul1) > ret void > } > > Is such a transformation best done as a (target-specific) DAG combine? > > A similar instcombine already exists for the X/C->X*1/C case (see the CvtFDivConstToReciprocal function in InstCombineMlDivRem.cpp), but I don't believe the above can be done as an instcombine as it creates a new instruction (in addition to replacing the original). Also, I only want to perform the transformation if there are multiple uses of 1/Y (like in my test case). Otherwise, the transformation replaces a fdiv with a fdiv+fmul pair, which I doubt would be profitable. > > FWIW, I'm also pretty sure this combine requires -fast-math. > > Can someone point me in the right direction?Isn't this http://llvm.org/bugs/show_bug.cgi?id=16218 ? I posted a patch there but never had the time to finish it. - Ben> > Thanks, > Chad > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
It is the very same bug. On Thu, Aug 8, 2013 at 1:05 PM, Benjamin Kramer <benny.kra at gmail.com> wrote:> > On 08.08.2013, at 18:25, Chad Rosier <chad.rosier at gmail.com> wrote: > > > I would like to transform X/Y -> X*1/Y. Specifically, I would like to > convert: > > > > define void @t1a(double %a, double %b, double %d) { > > entry: > > %div = fdiv fast double %a, %d > > %div1 = fdiv fast double %b, %d > > %call = tail call i32 @foo(double %div, double %div1) > > ret void > > } > > > > to: > > > > define void @t1b(double %a, double %b, double %d) { > > entry: > > %div = fdiv fast double 1.000000e+00, %d > > %mul = fmul fast double %div, %a > > %mul1 = fmul fast double %div, %b > > %call = tail call i32 @foo(double %mul, double %mul1) > > ret void > > } > > > > Is such a transformation best done as a (target-specific) DAG combine? > > > > A similar instcombine already exists for the X/C->X*1/C case (see the > CvtFDivConstToReciprocal function in InstCombineMlDivRem.cpp), but I don't > believe the above can be done as an instcombine as it creates a new > instruction (in addition to replacing the original). Also, I only want to > perform the transformation if there are multiple uses of 1/Y (like in my > test case). Otherwise, the transformation replaces a fdiv with a fdiv+fmul > pair, which I doubt would be profitable. > > > > FWIW, I'm also pretty sure this combine requires -fast-math. > > > > Can someone point me in the right direction? > > Isn't this http://llvm.org/bugs/show_bug.cgi?id=16218 ? I posted a patch > there but never had the time to finish it. > > - Ben > > > > > Thanks, > > Chad > > _______________________________________________ > > LLVM Developers mailing list > > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130808/414f75ab/attachment.html>
I did few transformation in Instruction *InstCombiner::visitFDiv() in an attempt to remove some divs. I may miss this case. If you need to implement this rule, it is better done in Instcombine than in DAG combine. Doing such xform early expose the redundancy of 1/y, which have positive impact to neighboring code, while DAG combine is bit blind. You should be very careful, reciprocal is very very very imprecise transformation. Sometimes you will see big different with and without this xform. On 8/8/13 9:25 AM, Chad Rosier wrote:> I would like to transform X/Y -> X*1/Y. Specifically, I would like to > convert: > > define void @t1a(double %a, double %b, double %d) { > entry: > %div = fdiv fast double %a, %d > %div1 = fdiv fast double %b, %d > %call = tail call i32 @foo(double %div, double %div1) > ret void > } > > to: > > define void @t1b(double %a, double %b, double %d) { > entry: > %div = fdiv fast double 1.000000e+00, %d > %mul = fmul fast double %div, %a > %mul1 = fmul fast double %div, %b > %call = tail call i32 @foo(double %mul, double %mul1) > ret void > } > > Is such a transformation best done as a (target-specific) DAG combine? > > A similar instcombine already exists for the X/C->X*1/C case (see the > CvtFDivConstToReciprocal function in InstCombineMlDivRem.cpp), but I > don't believe the above can be done as an instcombine as it creates a > new instruction (in addition to replacing the original). Also, I only > want to perform the transformation if there are multiple uses of 1/Y > (like in my test case). Otherwise, the transformation replaces a fdiv > with a fdiv+fmul pair, which I doubt would be profitable. > > FWIW, I'm also pretty sure this combine requires -fast-math. > > Can someone point me in the right direction? > > Thanks, > Chad > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130808/169bb9a6/attachment.html>
I remember why I didn't implement this rule in Instcombine. It add one instruction. So, this xform should be driven by a redundancy eliminator if you care code size. On 8/8/13 10:13 AM, Shuxin Yang wrote:> I did few transformation in Instruction *InstCombiner::visitFDiv() in > an attempt to remove some divs. > I may miss this case. If you need to implement this rule, it is > better done in Instcombine than in DAG combine. > Doing such xform early expose the redundancy of 1/y, which have > positive impact to neighboring code, > while DAG combine is bit blind. > > You should be very careful, reciprocal is very very very imprecise > transformation. Sometimes you will see big different > with and without this xform. > > On 8/8/13 9:25 AM, Chad Rosier wrote: >> I would like to transform X/Y -> X*1/Y. Specifically, I would like to >> convert: >> >> define void @t1a(double %a, double %b, double %d) { >> entry: >> %div = fdiv fast double %a, %d >> %div1 = fdiv fast double %b, %d >> %call = tail call i32 @foo(double %div, double %div1) >> ret void >> } >> >> to: >> >> define void @t1b(double %a, double %b, double %d) { >> entry: >> %div = fdiv fast double 1.000000e+00, %d >> %mul = fmul fast double %div, %a >> %mul1 = fmul fast double %div, %b >> %call = tail call i32 @foo(double %mul, double %mul1) >> ret void >> } >> >> Is such a transformation best done as a (target-specific) DAG combine? >> >> A similar instcombine already exists for the X/C->X*1/C case (see the >> CvtFDivConstToReciprocal function in InstCombineMlDivRem.cpp), but I >> don't believe the above can be done as an instcombine as it creates a >> new instruction (in addition to replacing the original). Also, I >> only want to perform the transformation if there are multiple uses of >> 1/Y (like in my test case). Otherwise, the transformation replaces a >> fdiv with a fdiv+fmul pair, which I doubt would be profitable. >> >> FWIW, I'm also pretty sure this combine requires -fast-math. >> >> Can someone point me in the right direction? >> >> Thanks, >> Chad >> >> >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130808/fb576dd0/attachment.html>
I believe the advice that Owen gave me was that if it's simple enough, we should do it in both places. (Feel free to chime in if I'm misquoting you, Owen.) Performing the transformation early as an InstCombine can expose additional opportunities to optimize code. The purpose of the redundant DAGCombine would be to catch the case where the optimization is exposed by another DAG combine. And as Jim also pointed out, the DAG combine has the benefit of target-specific knowledge. I agree, this will require quite a bit of testing. Chad On Thu, Aug 8, 2013 at 1:13 PM, Shuxin Yang <shuxin.llvm at gmail.com> wrote:> I did few transformation in Instruction *InstCombiner::visitFDiv() in an > attempt to remove some divs. > I may miss this case. If you need to implement this rule, it is better > done in Instcombine than in DAG combine. > Doing such xform early expose the redundancy of 1/y, which have positive > impact to neighboring code, > while DAG combine is bit blind. > > You should be very careful, reciprocal is very very very imprecise > transformation. Sometimes you will see big different > with and without this xform. > > On 8/8/13 9:25 AM, Chad Rosier wrote: > > I would like to transform X/Y -> X*1/Y. Specifically, I would like to > convert: > > define void @t1a(double %a, double %b, double %d) { > entry: > %div = fdiv fast double %a, %d > %div1 = fdiv fast double %b, %d > %call = tail call i32 @foo(double %div, double %div1) > ret void > } > > to: > > define void @t1b(double %a, double %b, double %d) { > entry: > %div = fdiv fast double 1.000000e+00, %d > %mul = fmul fast double %div, %a > %mul1 = fmul fast double %div, %b > %call = tail call i32 @foo(double %mul, double %mul1) > ret void > } > > Is such a transformation best done as a (target-specific) DAG combine? > > A similar instcombine already exists for the X/C->X*1/C case (see the > CvtFDivConstToReciprocal function in InstCombineMlDivRem.cpp), but I don't > believe the above can be done as an instcombine as it creates a new > instruction (in addition to replacing the original). Also, I only want to > perform the transformation if there are multiple uses of 1/Y (like in my > test case). Otherwise, the transformation replaces a fdiv with a fdiv+fmul > pair, which I doubt would be profitable. > > FWIW, I'm also pretty sure this combine requires -fast-math. > > Can someone point me in the right direction? > > Thanks, > Chad > > > _______________________________________________ > LLVM Developers mailing listLLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.eduhttp://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130808/3a1254c2/attachment.html>
Thanks for the input, Jim. I'm kinda torn because I have the same preference as you (i.e., a DAG combine), but Ben seems to have already proposed a good solution as an InstCombine with a little cleanup. Perhaps, I'll implement both and then do some analysis. :D Chad On Thu, Aug 8, 2013 at 12:56 PM, Jim Grosbach <grosbach at apple.com> wrote:> Hi Chad, > > This is a great transform to do, but you’re right that it’s only safe > under fast-math. This is particularly interesting when the original divisor > is a constant so you can materialize the reciprocal at compile-time. You’re > right that in either case, this optimization should only kick in when there > is more than one divide instruction that will be changed to a mul. > > I don’t have a strong preference for instcombine vs. dagcombine, though I > lean slightly towards later when we’ll have more target information > available if we want to apply a more complicated cost function for some > targets. > > -Jim > > > On Aug 8, 2013, at 9:25 AM, Chad Rosier <chad.rosier at gmail.com> wrote: > > I would like to transform X/Y -> X*1/Y. Specifically, I would like to > convert: > > define void @t1a(double %a, double %b, double %d) { > entry: > %div = fdiv fast double %a, %d > %div1 = fdiv fast double %b, %d > %call = tail call i32 @foo(double %div, double %div1) > ret void > } > > to: > > define void @t1b(double %a, double %b, double %d) { > entry: > %div = fdiv fast double 1.000000e+00, %d > %mul = fmul fast double %div, %a > %mul1 = fmul fast double %div, %b > %call = tail call i32 @foo(double %mul, double %mul1) > ret void > } > > Is such a transformation best done as a (target-specific) DAG combine? > > A similar instcombine already exists for the X/C->X*1/C case (see the > CvtFDivConstToReciprocal function in InstCombineMlDivRem.cpp), but I don't > believe the above can be done as an instcombine as it creates a new > instruction (in addition to replacing the original). Also, I only want to > perform the transformation if there are multiple uses of 1/Y (like in my > test case). Otherwise, the transformation replaces a fdiv with a fdiv+fmul > pair, which I doubt would be profitable. > > FWIW, I'm also pretty sure this combine requires -fast-math. > > Can someone point me in the right direction? > > Thanks, > Chad > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130808/99751415/attachment.html>
On Thu, Aug 08, 2013 at 10:13:07AM -0700, Shuxin Yang wrote:> You should be very careful, reciprocal is very very very imprecise > transformation. Sometimes you will see big different > with and without this xform.What about constant %a, %b in this case? At least for power-of-two arguments, wouldn't it still be precise? Joerg
On Aug 8, 2013, at 9:56 AM, Jim Grosbach <grosbach at apple.com> wrote:> Hi Chad, > > This is a great transform to do, but you’re right that it’s only safe under fast-math. This is particularly interesting when the original divisor is a constant so you can materialize the reciprocal at compile-time. You’re right that in either case, this optimization should only kick in when there is more than one divide instruction that will be changed to a mul.It can be worthwhile to do this even in the case where there is only a single divide since 1/Y might be loop invariant, and could then be hoisted out later by LICM. You just need to be able to fold it back together when there is only a single use, and that use is not inside a more deeply nested loop.> > I don’t have a strong preference for instcombine vs. dagcombine, though I lean slightly towards later when we’ll have more target information available if we want to apply a more complicated cost function for some targets. > > -Jim > > > On Aug 8, 2013, at 9:25 AM, Chad Rosier <chad.rosier at gmail.com> wrote: > >> I would like to transform X/Y -> X*1/Y. Specifically, I would like to convert: >> >> define void @t1a(double %a, double %b, double %d) { >> entry: >> %div = fdiv fast double %a, %d >> %div1 = fdiv fast double %b, %d >> %call = tail call i32 @foo(double %div, double %div1) >> ret void >> } >> >> to: >> >> define void @t1b(double %a, double %b, double %d) { >> entry: >> %div = fdiv fast double 1.000000e+00, %d >> %mul = fmul fast double %div, %a >> %mul1 = fmul fast double %div, %b >> %call = tail call i32 @foo(double %mul, double %mul1) >> ret void >> } >> >> Is such a transformation best done as a (target-specific) DAG combine? >> >> A similar instcombine already exists for the X/C->X*1/C case (see the CvtFDivConstToReciprocal function in InstCombineMlDivRem.cpp), but I don't believe the above can be done as an instcombine as it creates a new instruction (in addition to replacing the original). Also, I only want to perform the transformation if there are multiple uses of 1/Y (like in my test case). Otherwise, the transformation replaces a fdiv with a fdiv+fmul pair, which I doubt would be profitable. >> >> FWIW, I'm also pretty sure this combine requires -fast-math. >> >> Can someone point me in the right direction? >> >> Thanks, >> Chad >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130808/6c2c3834/attachment.html>
Seems incorrect but I forget the IEEE fp rules. What if both x and y are infinity? in that case x/y = NAN but you transformation will yield 0 as the result. On 08/08/2013 09:25 AM, Chad Rosier wrote:> I would like to transform X/Y -> X*1/Y. Specifically, I would like to > convert: > > define void @t1a(double %a, double %b, double %d) { > entry: > %div = fdiv fast double %a, %d > %div1 = fdiv fast double %b, %d > %call = tail call i32 @foo(double %div, double %div1) > ret void > } > > to: > > define void @t1b(double %a, double %b, double %d) { > entry: > %div = fdiv fast double 1.000000e+00, %d > %mul = fmul fast double %div, %a > %mul1 = fmul fast double %div, %b > %call = tail call i32 @foo(double %mul, double %mul1) > ret void > } > > Is such a transformation best done as a (target-specific) DAG combine? > > A similar instcombine already exists for the X/C->X*1/C case (see the > CvtFDivConstToReciprocal function in InstCombineMlDivRem.cpp), but I > don't believe the above can be done as an instcombine as it creates a > new instruction (in addition to replacing the original). Also, I only > want to perform the transformation if there are multiple uses of 1/Y > (like in my test case). Otherwise, the transformation replaces a fdiv > with a fdiv+fmul pair, which I doubt would be profitable. > > FWIW, I'm also pretty sure this combine requires -fast-math. > > Can someone point me in the right direction? > > Thanks, > Chad > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >
On Thu, Aug 8, 2013 at 2:35 PM, Reed Kotler <rkotler at mips.com> wrote:> Seems incorrect but I forget the IEEE fp rules. > > What if both x and y are infinity? > > in that case x/y = NAN but you transformation will yield 0 as the result. >This is being proposed for -ffast-math. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130808/a17d9892/attachment.html>