This is an archive of the discontinued LLVM Phabricator instance.

[GlobalISel][AArch64] Add support for @llvm.cos and @llvm.sin intrinsics
ClosedPublic

Authored by paquette on Jan 24 2019, 3:27 PM.

Details

Reviewers
aemerson
dsanders
Summary

This adds instruction selection support for the @llvm.cos and @llvm.sin intrinsics.

It adds the G_FCOS and G_FSIN generic instructions, vector support for them, and support for lowering them to the appropriate RTLib calls.

It also adds the relevant legalizer tests, and Global ISel checks to existing non-GISel tests scattered about test/CodeGen/AArch64.

Macro all_the_things: SELECT ALL THE TRIG INTRINSICS

Diff Detail

Event Timeline

paquette created this revision.Jan 24 2019, 3:27 PM
arsenm added a subscriber: arsenm.Jan 24 2019, 3:30 PM
arsenm added inline comments.
lib/Target/AArch64/AArch64LegalizerInfo.cpp
147–151

.scalarize once I commit that

153–155

minScalar(0, s32)

paquette updated this revision to Diff 183421.Jan 24 2019, 3:39 PM

Updated to address @arsenm's comments.

paquette marked 2 inline comments as done.Jan 24 2019, 3:39 PM
aemerson accepted this revision.Jan 25 2019, 4:52 PM

LGTM, but can you add the changes to introduce a new opcode and IR translator test as a separate commit.

lib/CodeGen/GlobalISel/LegalizerHelper.cpp
227

Can you add a check while you're here to bail out if we have a Size > 64.

test/CodeGen/AArch64/GlobalISel/legalize-cos.mir
77

These BL checks can just be normal CHECKs right?

This revision is now accepted and ready to land.Jan 25 2019, 4:52 PM
paquette closed this revision.Jan 28 2019, 10:35 AM
paquette marked 2 inline comments as done.

Thanks! Split it into 3 commits:

r352400 - Adds the instructions
r352401 - Adds the IRTranslator changes
r352402 - Adds the legalizer changes