[PATCH] D41338: [CodeGen] lower math intrinsics to finite version of libcalls when possible (PR35672)

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 17 16:53:58 PST 2017


spatel created this revision.
spatel added reviewers: hfinkel, efriedma, andrew.w.kaylor.
Herald added a subscriber: mcrosier.

This is a partial implementation of a fix for PR35672:
https://bugs.llvm.org/show_bug.cgi?id=35672

If this is on the right track, then I can add similar code for other transcendentals (exp2, log, log10, log2, pow).

Some questions:

1. Do the finite calls need the double-leading underscores? I saw an existing test with __sqrt_finite, so I assume we want those, but I'm not sure if/how the regular calls acquire the underscores.
2. Does this make sense for ISD::STRICT_FEXP (the strict version of the node)?
3. Does the mathlib actually support the long double variants?


https://reviews.llvm.org/D41338

Files:
  include/llvm/CodeGen/RuntimeLibcalls.def
  include/llvm/CodeGen/SelectionDAG.h
  lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
  lib/CodeGen/SelectionDAG/SelectionDAG.cpp
  lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
  test/CodeGen/X86/finite-libcalls.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D41338.127295.patch
Type: text/x-patch
Size: 6260 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171218/baf42b6f/attachment.bin>


More information about the llvm-commits mailing list