Page MenuHomePhabricator

[WIP][RFC][CodeGen] Add support for complex multiplication
Needs ReviewPublic

Authored by NickGuy on Nov 18 2021, 10:29 AM.

Details

Summary

Add ComplexArithmeticPass.cpp, implementing a potential approach for supporting
complex numbers in a target-independent manner, deferring to the TargetTransformInfo
for the given target to create a target-specific intrinsic.

This approach performs a naive check to find a complex case (<8 x float> which exceeds the width of a
standard vector register), before dropping down to a more granular check for simpler cases. This
granular method evaluates the instructions within a BasicBlock, identifying potential candidates and
tries to pair them up for each side of the complex multiply.

Diff Detail

Event Timeline

NickGuy created this revision.Nov 18 2021, 10:29 AM
NickGuy requested review of this revision.Nov 18 2021, 10:29 AM
fhahn added a subscriber: fhahn.Nov 18 2021, 10:39 AM

Nice one Nick.
Can you first run clang-format on this patch? It is pretty much unreadable with all these lint messages.

NickGuy updated this revision to Diff 388438.Nov 19 2021, 2:29 AM

Nice one Nick.
Can you first run clang-format on this patch? It is pretty much unreadable with all these lint messages.

Hmm, looks like my pre-commit hook isn't working anymore, that's disappointing, Should be formatted now though.
Thanks for spreading the word on this too.

Some context for everyone else, this is a prototype of a potential approach for implementing complex number support. Reviews about the general approach, rather than specific implementation details, would be preferred at this stage.

mdchen added a subscriber: mdchen.Nov 22 2021, 2:57 AM
telans added a subscriber: telans.Nov 23 2021, 1:20 AM
simoll added a subscriber: simoll.Nov 30 2021, 12:18 AM
Matt added a subscriber: Matt.Wed, Jan 12, 2:31 PM