This is an archive of the discontinued LLVM Phabricator instance.

Fix MSP430 calling convention to match MSPGCC
ClosedPublic

Authored by jobnoorman on Jul 3 2013, 7:44 AM.

Details

Reviewers
jobnoorman
asl
Summary

This patch fixes the MSP430 calling convention by implementing most parts in C++ instead of tablegen.

After having asked a question about this on llvm-dev and receiving an answer from a maintainer of the AVR backend, I think using custom C++ code is necessary mainly for the following reasons:

  • Split arguments are assigned to registers in big-endian order which cannot be done using tablegen since the MSP430 is little-endian.
  • Split arguments should either be placed completely in registers or completely on the stack but never be mixed. I don't think there is a way to enforce this in tablegen.

Note that this patch is heavily inspired by the calling convention implementation of the AVR backend.

PS: I created a new revision since D1046 only deals with the return value part of the calling convention while this patch also handles arguments.

Diff Detail

Event Timeline

asl added a comment.Jul 3 2013, 1:33 PM

Looks great! Give me some time to review.

Did you have time to look at this yet?

Me and some colleagues have been using it for a while and it seems to work well. So I would like to commit it if you approve of it.

asl added a comment.Jul 22 2013, 11:49 AM

Hi

Yes, this is in my review list. Have you requested commit access from Chris?

Hi Anton,

Yes, Chris has given me commit access.

asl added a comment.Sep 8 2013, 9:57 AM

LGTM. Sorry for the late response

jobnoorman accepted this revision.Oct 15 2013, 1:24 AM

r192678.

jobnoorman closed this revision.Oct 15 2013, 1:28 AM