Robison, Arch
2014-Dec-10 21:17 UTC
[LLVMdev] Best way for JIT to query whether llvm.fma.* is fast?
Thanks! That’s probably close enough for practical purposes. I looked at the overrides on various targets, and they all return true if the FMA hardware exists. - Arch From: Jingyue Wu [mailto:jingyue at google.com] Sent: Wednesday, December 10, 2014 2:56 PM To: Robison, Arch Cc: llvmdev at cs.uiuc.edu Subject: Re: [LLVMdev] Best way for JIT to query whether llvm.fma.* is fast? Does TargetLowering::isFMAFasterThanFMulAndFAdd (http://llvm.org/docs/doxygen/html/TargetLowering_8h_source.html#l01499) help? Jingyue On Wed, Dec 10, 2014 at 12:48 PM, Robison, Arch <arch.robison at intel.com<mailto:arch.robison at intel.com>> wrote: For the Julia language JIT, we’d like be able to tell whether the llvm.fma.* intrinsic has hardware support. What’s the best way to query LLVM (JIT) for this information? The information would be used in situations where the user wants to use different algorithms depending on whether FMA hardware is present or not. - Arch D. Robison _______________________________________________ LLVM Developers mailing list LLVMdev at cs.uiuc.edu<mailto: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/20141210/6a8cba1c/attachment.html>
Lang Hames
2014-Dec-12 17:15 UTC
[LLVMdev] Best way for JIT to query whether llvm.fma.* is fast?
Hi Arch, Also, consider just emitting the llvm.fmuladd intrinsic instead of llvm.fma. fmuladd is lowered to llvm.fma in codegen if the optimizer determines that it's beneficial, otherwise it is expanded to a mul and an add. At the moment I think SelectionDAG is just checking isFMAFasterThanFMulAndFAdd anyway, but that condition could be refined in the future. Cheers, Lang. On Wed, Dec 10, 2014 at 1:17 PM, Robison, Arch <arch.robison at intel.com> wrote:> Thanks! That’s probably close enough for practical purposes. I looked > at the overrides on various targets, and they all return true if the FMA > hardware exists. > > > > - Arch > > > > *From:* Jingyue Wu [mailto:jingyue at google.com] > *Sent:* Wednesday, December 10, 2014 2:56 PM > *To:* Robison, Arch > *Cc:* llvmdev at cs.uiuc.edu > *Subject:* Re: [LLVMdev] Best way for JIT to query whether llvm.fma.* is > fast? > > > > Does TargetLowering::isFMAFasterThanFMulAndFAdd ( > http://llvm.org/docs/doxygen/html/TargetLowering_8h_source.html#l01499) > help? > > > > Jingyue > > > > On Wed, Dec 10, 2014 at 12:48 PM, Robison, Arch <arch.robison at intel.com> > wrote: > > For the Julia language JIT, we’d like be able to tell whether the > llvm.fma.* intrinsic has hardware support. What’s the best way to query > LLVM (JIT) for this information? > > > > The information would be used in situations where the user wants to use > different algorithms depending on whether FMA hardware is present or not. > > > > - Arch D. Robison > > > > > _______________________________________________ > 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/20141212/689d6197/attachment.html>
Robison, Arch
2014-Dec-12 18:04 UTC
[LLVMdev] Best way for JIT to query whether llvm.fma.* is fast?
Thanks for the tip. Indeed the current plan is to have Julia functions the correspond to both llvm.fmuladd and llvm.fma. Discussion is at https://github.com/JuliaLang/julia/pull/8112 . - Arch From: Lang Hames [mailto:lhames at gmail.com] Sent: Friday, December 12, 2014 11:16 AM To: Robison, Arch Cc: Jingyue Wu; llvmdev at cs.uiuc.edu Subject: Re: [LLVMdev] Best way for JIT to query whether llvm.fma.* is fast? Hi Arch, Also, consider just emitting the llvm.fmuladd intrinsic instead of llvm.fma. fmuladd is lowered to llvm.fma in codegen if the optimizer determines that it's beneficial, otherwise it is expanded to a mul and an add. At the moment I think SelectionDAG is just checking isFMAFasterThanFMulAndFAdd anyway, but that condition could be refined in the future. Cheers, Lang. On Wed, Dec 10, 2014 at 1:17 PM, Robison, Arch <arch.robison at intel.com<mailto:arch.robison at intel.com>> wrote: Thanks! That’s probably close enough for practical purposes. I looked at the overrides on various targets, and they all return true if the FMA hardware exists. - Arch From: Jingyue Wu [mailto:jingyue at google.com<mailto:jingyue at google.com>] Sent: Wednesday, December 10, 2014 2:56 PM To: Robison, Arch Cc: llvmdev at cs.uiuc.edu<mailto:llvmdev at cs.uiuc.edu> Subject: Re: [LLVMdev] Best way for JIT to query whether llvm.fma.* is fast? Does TargetLowering::isFMAFasterThanFMulAndFAdd (http://llvm.org/docs/doxygen/html/TargetLowering_8h_source.html#l01499) help? Jingyue On Wed, Dec 10, 2014 at 12:48 PM, Robison, Arch <arch.robison at intel.com<mailto:arch.robison at intel.com>> wrote: For the Julia language JIT, we’d like be able to tell whether the llvm.fma.* intrinsic has hardware support. What’s the best way to query LLVM (JIT) for this information? The information would be used in situations where the user wants to use different algorithms depending on whether FMA hardware is present or not. - Arch D. Robison _______________________________________________ LLVM Developers mailing list LLVMdev at cs.uiuc.edu<mailto: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<mailto: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/20141212/030ff9c5/attachment.html>