[llvm-dev] Why is llvm.maxnum.f32 coming through unreduced?

Rodney M. Bates via llvm-dev llvm-dev at lists.llvm.org
Mon Nov 16 09:45:29 PST 2015



On 11/15/2015 01:29 PM, Tim Northover wrote:
> On 15 November 2015 at 09:01, Rodney M. Bates via llvm-dev
> <llvm-dev at lists.llvm.org> wrote:
>> The latter is reduced to machine code by llc, the former is not, instead
>> coming through as an external function call, which then fails to link.
>
> Is this for x86? I don't think that has a single instruction to
> implement floating-point maximum so I'd expect LLVM to produce a call
> to fmax. Sanjay seems to have proposed an efficient inlined version
> (https://llvm.org/bugs/show_bug.cgi?id=24475), but given that the
> bug's still open it probably hasn't actually been implemented.

Yes, it's x86_64.  That makes sense, but I can't find the needed library,
which was what I first tried.  I already have -lm in my link command, and
nm on my libm doesn't get it.

With a link name like "llvm.maxnum.f32", I would expect it to be provided
by the llvm distribution.  But I find no occurrence in either my installed
lib directory nor my build directory, using nm and grep.  The closest I can
find is a mangled name with only "maxnum" as a substring.  In my source
directory, it occurs only in llvm assembly code, with a "@" prefix, in
subdirectories doc and test.

Am I be missing part of llvm?  I do have compiler-rt.

>
> To get the libcall working (depending on the platform), you might need
> to link against libm.
>
> Cheers.
>
> Tim.
>

-- 
Rodney Bates
rodney.m.bates at acm.org


More information about the llvm-dev mailing list