This is an archive of the discontinued LLVM Phabricator instance.

[Clang][RISCV] Set native half type to legal when has zfh extension
AbandonedPublic

Authored by Yunzezhu on Apr 27 2023, 7:34 PM.

Details

Summary

Issue: When processing a f16 type value, a f16 value is extended to f32 after load and processed in f32 form, and truncated back to f16 before store, even when the target has zfh extension, which indicates the target has native half type float support, and such kind of extend/truncate actions are not necessary.

Some changes:
1.Set native half type to legal when has zfh extension, which prevent unnecessary promotion from f16 to f32, and unpromotion back to f16.
2.Add related test case to test generation of half type float.

Diff Detail

Event Timeline

Yunzezhu created this revision.Apr 27 2023, 7:34 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 27 2023, 7:34 PM
Yunzezhu requested review of this revision.Apr 27 2023, 7:34 PM
Yunzezhu abandoned this revision.Apr 27 2023, 11:57 PM

Yes and I will abandon this one.