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

Rodney M. Bates via llvm-dev llvm-dev at lists.llvm.org
Sun Nov 15 09:01:54 PST 2015


I have a smallish compilation that contains calls on intrinsics
@llvm.maxnum.f32 and @llvm.fabs.f32:

   %fminmax = call float @llvm.maxnum.f32(float %fabs5, float %fabs)
   %fabs = call float @llvm.fabs.f32(float %v.6)

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.


I can't see any differences that look significant to me.  Both have declarations:

   ; Function Attrs: nounwind readnone
   declare float @llvm.maxnum.f32(float, float) #2
   ; Function Attrs: nounwind readonly
   declare float @llvm.fabs.f32(float) #1

These are both created in my front end by effectively calling (after
removing some levels of bindings, wrappings, etc.)

   Intrinsic::getDeclaration( M, Intrinsic::maxnum, Tys)
   Intrinsic::getDeclaration( M, Intrinsic::fabs, Tys)

where Tys contains a single floating type.

As generated, both declarations occur after the calls, but moving the
maxnum decl before the calls changes nothing.

This is llvm 3.6.1.

Any help would be appreciated.

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


More information about the llvm-dev mailing list