[llvm-dev] Override TargetOptions for block of code?

Hal Finkel via llvm-dev llvm-dev at lists.llvm.org
Wed Jun 28 11:57:29 PDT 2017


On 06/28/2017 01:48 PM, Jason wrote:
> Is there any way to provide the inverse? Ie, fast math enabled by 
> default, but disable rcp using the flags for a specific div?

No, but you can enable fast-math flags by default in the IRBuilder (by 
calling setFastMathFlags).

  -Hal

>
> On Wed, Jun 28, 2017 at 10:53 AM, Hal Finkel <hfinkel at anl.gov 
> <mailto:hfinkel at anl.gov>> wrote:
>
>     Hi, Jason,
>
>     You shouldn't need to use UsafeFPMath at all now. Instead, use
>     fast-math flags on the relevant instructions. See:
>     http://llvm.org/docs/LangRef.html#fast-math-flags
>     <http://llvm.org/docs/LangRef.html#fast-math-flags>
>
>      -Hal
>
>     On 06/28/2017 12:29 PM, Jason via llvm-dev wrote:
>>     Hi, we generally run our JIT with UnsafeFPMath enabled, but there
>>     are a few specific instances where a block of code needs to
>>     follow strict FPMath. Is there a way to temporarily override
>>     TargetOptions for a specific block of IR?
>>
>>
>>
>>
>>     _______________________________________________
>>     LLVM Developers mailing list
>>     llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org>
>>     http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>>     <http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev>
>
>     -- 
>     Hal Finkel
>     Lead, Compiler Technology and Programming Languages
>     Leadership Computing Facility
>     Argonne National Laboratory
>
-- 
Hal Finkel
Lead, Compiler Technology and Programming Languages
Leadership Computing Facility
Argonne National Laboratory
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170628/f703bc89/attachment.html>


More information about the llvm-dev mailing list