Matt Arsenault via llvm-dev
2018-Aug-21 14:11 UTC
[llvm-dev] Condition code in DAGCombiner::visitFADDForFMACombine?
> On Aug 21, 2018, at 17:08, Ryan Taylor via llvm-dev <llvm-dev at lists.llvm.org> wrote: > > So I have a test case where: > > %20 = fmul nnan arcp float %15, %19 > %21 = fadd reassoc nnan arcp contract float %20, -1.000000e+00 > > is being contracted in DAG to fmad. Is this correct since the fmul has no reassoc or contract fast math flag? > > Thanks.fmad is defined as the exact same result as the separate fmul + fadd, unlike fma so this is OK -Matt
Ryan Taylor via llvm-dev
2018-Aug-21 14:57 UTC
[llvm-dev] Condition code in DAGCombiner::visitFADDForFMACombine?
Matt, I'm sorry, actually it's fma not fmad. In the post-legalizer DAG combine for the given code it's producing fma not fmad. That doens't seem correct. On Tue, Aug 21, 2018 at 10:11 AM Matt Arsenault <arsenm2 at gmail.com> wrote:> > > > On Aug 21, 2018, at 17:08, Ryan Taylor via llvm-dev < > llvm-dev at lists.llvm.org> wrote: > > > > So I have a test case where: > > > > %20 = fmul nnan arcp float %15, %19 > > %21 = fadd reassoc nnan arcp contract float %20, -1.000000e+00 > > > > is being contracted in DAG to fmad. Is this correct since the fmul has > no reassoc or contract fast math flag? > > > > Thanks. > > > fmad is defined as the exact same result as the separate fmul + fadd, > unlike fma so this is OK > > -Matt-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180821/bbfc21d6/attachment.html>
Matt Arsenault via llvm-dev
2018-Aug-21 15:04 UTC
[llvm-dev] Condition code in DAGCombiner::visitFADDForFMACombine?
> On Aug 21, 2018, at 17:57, Ryan Taylor <ryta1203 at gmail.com> wrote: > > Matt, > I'm sorry, actually it's fma not fmad. > > In the post-legalizer DAG combine for the given code it's producing fma not fmad. That doens't seem correct. >The contract is on the fadd. I’m not really sure what the rule is supposed to be for contract between the nodes. The LangRef doesn’t clarify on this. I would assume it would need to be present on both? -Matt