This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Implement straight-forward bf16<->int conversion cases
ClosedPublic

Authored by asb on Aug 2 2023, 2:15 PM.

Details

Summary

This ports over the test cases half-convert.ll and implements patterns or RISCVISelLowering.cpp changes for all of the most straight-forward cases (those that don't require changes outside of lib/Target/RISCV). The remaining cases and noted poor codegen for saturating conversions will be handled in follow-up patches.

Diff Detail

Event Timeline

asb created this revision.Aug 2 2023, 2:15 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 2 2023, 2:15 PM
asb requested review of this revision.Aug 2 2023, 2:15 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 2 2023, 2:15 PM
joshua-arch1 accepted this revision.Aug 3 2023, 12:41 AM
This revision is now accepted and ready to land.Aug 3 2023, 12:41 AM
joshua-arch1 added a comment.EditedAug 3 2023, 12:46 AM

Maybe we are now confronted with a general issue. Are there any other operations that cannot be converted into f32 in front-end? I think you have noticed comparison and bf16-to-integer conversion.

craig.topper added inline comments.Aug 3 2023, 1:00 AM
llvm/lib/Target/RISCV/RISCVISelLowering.cpp
2449

I don't think we need to use getSimpleValueType() here, we can use getValueType() and make the line shorter

asb updated this revision to Diff 546800.Aug 3 2023, 4:35 AM
asb marked an inline comment as done.

Address review comments.

This revision was landed with ongoing or failed builds.Aug 7 2023, 3:14 AM
This revision was automatically updated to reflect the committed changes.