[LLVMdev] On calling intrinsics

David Given dg at cowlark.com
Sun Jan 20 16:06:32 PST 2013

On 20/01/13 21:19, Craig Topper wrote:
> sqrtf is detected by code in SelectionDAGBuilder.cpp. This gets turns
> into a FSQRT ISD node type that the target can handle just like any
> other ISD node. If the target doesn't mark ISD::FSQRT as Legal or Custom
> then ExpandNode in LegalizeDAG.cpp turns it back into a sqrtf libcall.

Solved! It turns out that the secret is that SelectionDAGBuilder only
converts such libcalls into intrinsics *if they are marked readnone*.
Which, of course, I wasn't doing in my JIT.

Anyway, ta. I'm producing much better code now.

┌─── dg@cowlark.com ───── http://www.cowlark.com ─────
│ "Of course, on a sufficiently small planet, 40 km/hr is, in fact,
│ sufficient to punt the elastic spherical cow into low orbit." ---
│ Brooks Moses on r.a.sf.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 262 bytes
Desc: OpenPGP digital signature
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130121/2a3184ef/attachment.sig>

More information about the llvm-dev mailing list