This is an archive of the discontinued LLVM Phabricator instance.

Add TargetLoweringInfo hook for explicitly setting the ABI calling convention endianess
ClosedPublic

Authored by dylanmckay on May 16 2019, 5:06 AM.

Details

Summary

The endianess used in the calling convention does not always match the
endianess of the target on all architectures, namely AVR.

When an argument is too large to be legalised by the architecture and is
split for the ABI, a new hook TargetLoweringInfo::shouldSplitFunctionArgumentsAsLittleEndian
is queried to find the endianess that function arguments must be laid
out in.

This approach was recommended by Eli Friedman.

Originally reported in https://github.com/avr-rust/rust/issues/129.

Patch by Carl Peto.

Diff Detail

Repository
rL LLVM

Event Timeline

dylanmckay created this revision.May 16 2019, 5:06 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 16 2019, 5:06 AM
efriedma accepted this revision.May 20 2019, 12:58 PM

LGTM

include/llvm/CodeGen/TargetLowering.h
3541 ↗(On Diff #199792)

Maybe "for some calls"; this applies to basically all targets.

This revision is now accepted and ready to land.May 20 2019, 12:58 PM
dylanmckay marked an inline comment as done.May 20 2019, 10:44 PM

Thanks heaps for the quick turnaround @efriedma, I will amend the comment as I commit this patch.

include/llvm/CodeGen/TargetLowering.h
3541 ↗(On Diff #199792)

Good point, I will amend this as I commit it.

This revision was automatically updated to reflect the committed changes.