This is an archive of the discontinued LLVM Phabricator instance.

[TargetLowering][NFC] Document overloaded meaning of TypeSoftPromoteHalf
Needs ReviewPublic

Authored by asb on Aug 7 2023, 8:02 AM.

Details

Summary

As of D126953, TypeSoftPromoteHalf is set for bf16 if it isn't natively supported by a target. This overloads its meaning (and led to at least one bug - D157287 - due to code assuming TypeSoftPromoteHalf is only used for f16). This trivial patch documents how its meaning is overloaded.

Posting as a patch for review rather than directly committing because this seems like a good opportunity to check we're happy with overloading TypeSoftPromoteHalf's meaning.

I did grep for other TypeSoftPromoteHalf and didn't see any obvious issues. The SoftPromoteHalfResult and SoftPromoteHalfOperand code paths that gets used in this case ends up calling e.g. GetPromotionOpcode to properly handle the bf16 vs f16 case.

Diff Detail

Event Timeline

asb created this revision.Aug 7 2023, 8:02 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 7 2023, 8:02 AM
asb requested review of this revision.Aug 7 2023, 8:02 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 7 2023, 8:02 AM