This is an archive of the discontinued LLVM Phabricator instance.

[LegalizeDAG] Prevent LegalizeLoadOps from creating extloads that mix int and fp types.
ClosedPublic

Authored by craig.topper on Jul 11 2023, 9:59 PM.

Details

Summary

For RISC-V, getRegisterType for fp16 returns i16. i16->fp64 extload
is considered legal because the LoadExtActions defaults to Legal
for all entries. Only fp/fp and int/int entries are changed to
Expand fore RISC-V.

This patch detects the FP-ness has changed and won't try to call
isLoadExtLegal.

Alternatively, we could add Expand for int/fp and fp/int, but that
seemed a little silly.

Fixes #63816

Diff Detail

Event Timeline

craig.topper created this revision.Jul 11 2023, 9:59 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 11 2023, 9:59 PM
craig.topper requested review of this revision.Jul 11 2023, 9:59 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 11 2023, 9:59 PM
Herald added subscribers: MaskRay, wdng. · View Herald Transcript
craig.topper edited the summary of this revision. (Show Details)Jul 11 2023, 9:59 PM
wangpc accepted this revision.Jul 12 2023, 12:31 AM

LGTM

This revision is now accepted and ready to land.Jul 12 2023, 12:31 AM
asb accepted this revision.Jul 12 2023, 6:58 AM

LGTM.