efriedma added a comment.

> I agree. I think the problem is that this patch is trying to decide on a 
> global lowering strategy for llvm.* math intrinsics in 
> llvm/lib/Target/PowerPC/PPCISelLowering.cpp but such global decision making 
> does not go well with finer granularity of fast-math flags.

Hmm.  Instead of using setLibcallName() and letting the legalizer generate the 
calls, it should be possible to use custom lowering to generate the appropriate 
calls, at the cost of writing a little more code.

> My understanding is that the reason we need to handle intrinsic math 
> functions later is because of strength-reduction transformations like 
> pow(x,0.5) --> sqrt(x) that currently operate on intrinsic calls only.

instcombine should be primarily responsible for this sort of optimization.  See 
LibCallSimplifier::optimizePow.  I guess a few transforms (D51630 
<https://reviews.llvm.org/D51630> etc.) landed in DAGCombine; probably we could 
move them earlier.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D101759/new/

https://reviews.llvm.org/D101759

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to