Page MenuHomePhabricator

[Hexagon] Support for Linux/Musl ABI.
ClosedPublic

Authored by sidneym on Mar 4 2020, 12:48 PM.

Details

Summary

The clang driver updates needed to support Hexagon's Linux ABI.

This builds on what was added by https://reviews.llvm.org/rG7fee4fed4c75c13d0cec7ff3a043e0313a3abc55

Diff Detail

Event Timeline

sidneym created this revision.Mar 4 2020, 12:48 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 4 2020, 12:48 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
bcain added a comment.Mar 9 2020, 12:49 PM

In general, I recommend qualifying metric and threshold values with their associated units: bits, bytes, pages, etc. That way it's easy to see where the unit conversions are happening and easy to see whether the logic is correct without reasoning about how the value changes among lines.

Constants specified by the ABI should be designated with names and units [unless maybe this conflicts w/llvm project naming conventions?]

clang/lib/CodeGen/TargetInfo.cpp
7670

This 64 should probably be named something like HEXAGON_REGISTER_SIZE_BITS_MAX?

7691

32 here should be HEXAGON_REGISTER_SIZE_BITS_MIN maybe?

7783

I suggest:

uint64_t Offset = llvm::alignTo(CGF.getContext().getTypeSize(Ty) / CHAR_BIT, HEXAGON_MIN_STACK_ALIGN_BYTES);
7826
int ArgSizeBytes = CGF.getContext().getTypeSize(Ty) / CHAR_BIT;
if (ArgSizeBytes > HEXAGON_VA_REGISTER_LIMIT_BYTES)
    return EmitVAArgFromMemory(CGF, VAListAddr, Ty);

@kparzysz do you have any thoughts about those review comments?

@kparzysz do you have any thoughts about those review comments?

@sidneym is this just pulling existing contents downstream to go upstream? If so let's expedite this please

I'm not sure if it's worth defining these macros especially if this is the only place where they are used. We'd need a more coordinated effort to replace all 32's with named constants where it refers to a register size, and I'm not even sure if we could classify whether a given 32 is tied to a register size or not.

kparzysz accepted this revision.Mar 25 2020, 12:47 PM
This revision is now accepted and ready to land.Mar 25 2020, 12:47 PM
sidneym updated this revision to Diff 252950.Mar 26 2020, 12:38 PM

update for new tidy checks.

This revision was automatically updated to reflect the committed changes.