[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 18:32:39 PST 2015



On 11/16/2015 11:54 AM, Tim Northover wrote:
> On 16 November 2015 at 09:45, Rodney M. Bates <rodney_bates at lcwb.coop> wrote:
>> With a link name like "llvm.maxnum.f32", I would expect it to be provided
>> by the llvm distribution.
>
> Ah, it ought to have been converted into an "fmaxf" call. It's
> possible that's a bug in LLVM 3.6 and the intrinsic wasn't supported
> on x86 then, since it works for me on trunk:
>
> $ cat simple.ll
> define float @foo(float %l, float %r) {
>    %res = call float @llvm.maxnum.f32(float %l, float %r)
>    ret float %res
> }
> declare float @llvm.maxnum.f32(float, float)
> $ bin/llc -mtriple=x86_64-apple-darwin simple.ll -o -
> [...]
> foo:                                    # @foo
>      .cfi_startproc
> # BB#0:
>      jmp fmaxf                   # TAILCALL
>      .cfi_endproc
>
> Alternatively (if that works for you too), it might be some kind of
> misconfiguration in your front-end, though that seems a bit unlikely.
>

Thanks, this got me going.  Actually, it was an installation error.
llc 3.6.1 handles it correctly, but an old llc 3.4.2 was getting picked
up instead, and it does not.

> Tim.
>

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


More information about the llvm-dev mailing list