This is an archive of the discontinued LLVM Phabricator instance.

[AVR] Add support for lrint and lround intrinsics
ClosedPublic

Authored by aykevl on Jan 1 2023, 10:27 AM.

Details

Summary

Integer legalization already supported splitting the output integer of
llround and llrint, but did not support this for lround and lrint yet.
This is not a problem for 32-bit architectures, but for 8/16-bit
architectures like AVR this results in a crash like this:

ExpandIntegerResult #0: t7: i32 = lround t6

LLVM ERROR: Do not know how to expand the result of this operator!

This patch simply add lrint/lround to the list of ISD opcodes to expand.

Fixes https://github.com/llvm/llvm-project/issues/59573.

Diff Detail

Event Timeline

aykevl created this revision.Jan 1 2023, 10:27 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 1 2023, 10:27 AM
aykevl requested review of this revision.Jan 1 2023, 10:27 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 1 2023, 10:27 AM
benshi001 accepted this revision.Jan 1 2023, 7:27 PM

LGTM! How about other reviewer's idea ?

This revision is now accepted and ready to land.Jan 1 2023, 7:27 PM
craig.topper accepted this revision.Jan 2 2023, 11:00 AM

LGTM. Please add [SelectionDAG] or [LegalizeTypes] to the commit title when you commit since it is touching common infrastructure and not just AVR target code.

This revision was landed with ongoing or failed builds.Jan 8 2023, 9:56 AM
This revision was automatically updated to reflect the committed changes.