[llvm-dev] Should llvm optimize 1.0 / x ?

Alexandre Bique via llvm-dev llvm-dev at lists.llvm.org
Tue Sep 1 00:35:19 PDT 2020


On Tue, Sep 1, 2020 at 9:05 AM Hal Finkel <hfinkel at anl.gov> wrote:
> Perhaps it's better ;)
>
> It looks like the compiler has generated one Newton iteration after the
> estimate to increase the precision of the answer. The reciprocal
> estimate is, after all, only an estimate, and for many applications, is
> not sufficient on its own.

Yes.

> This behavior is generally adjustable. Try using -mrecip=vec-divf:0 (or
> -mrecip=all:0) to turn off all of the Newton iterations.

Thank you very much! It did the job!
-- 
Alexandre BIQUE


More information about the llvm-dev mailing list