[PATCH] D101759: [PowerPC] Scalar IBM MASS library conversion pass

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 30 14:41:32 PDT 2021


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



More information about the llvm-commits mailing list