This is an archive of the discontinued LLVM Phabricator instance.

[X86][BF16] Share FP16 vector ABI with BF16
ClosedPublic

Authored by pengfei on May 30 2023, 7:39 AM.

Details

Summary

The ABI of BF16 is identical to FP16 rather than i16.

Fixes #62997

Diff Detail

Event Timeline

pengfei created this revision.May 30 2023, 7:39 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 30 2023, 7:39 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
pengfei requested review of this revision.May 30 2023, 7:39 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 30 2023, 7:39 AM
RKSimon added inline comments.May 30 2023, 8:25 AM
llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
642

Do we need a TLI callback / legality check for f16?

pengfei added inline comments.May 30 2023, 11:01 PM
llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
642

I think not. The PartVT comes from TLI.getRegisterTypeForCallingConv. We don't need to add another callback and targets use this way should have already made f16 legal.
I can add an TLI.isTypeLegal(PartVT) if you wish.

pengfei updated this revision to Diff 529292.Jun 7 2023, 7:20 AM

Add assert for type legal.

RKSimon accepted this revision.Jun 8 2023, 7:03 AM

LGTM

This revision is now accepted and ready to land.Jun 8 2023, 7:03 AM
This revision was automatically updated to reflect the committed changes.