This is an archive of the discontinued LLVM Phabricator instance.

[CodeGen] Expand complex multiply and divide intrinsics for codegen.
Needs ReviewPublic

Authored by jcranmer-intel on Feb 8 2022, 2:15 PM.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

For architectures without complex multiply or divide intrinsics (most of them),
a pass is needed to expand these intrinsics before codegen.

The tricky thing here is that where the intrinsics need to expand into a
compiler-rt helper function (e.g., __mulsc3), the ABI of complex floating point
types needs to be retrieved from the target. However, this target information
isn't fully validated for all targets, only x86.

This also adds support for lowering the complex multiple intrinsic directly to
instructions for the x86 backend.

Depends on D119286

Diff Detail

Event Timeline

jcranmer-intel created this revision.Feb 8 2022, 2:15 PM
jcranmer-intel requested review of this revision.Feb 8 2022, 2:15 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 8 2022, 2:15 PM
jcranmer-intel added inline comments.Feb 9 2022, 11:26 AM
llvm/test/Transforms/InstCombine/complex-math.ll
1

This file should have been in D119288 instead of this patch, I don't know how I missed that...

Matt added a subscriber: Matt.Feb 9 2022, 12:24 PM