This is an archive of the discontinued LLVM Phabricator instance.

[AArch64] Include AArch64GenCallingConv.inc once
ClosedPublic

Authored by rnk on Jan 18 2019, 4:46 PM.

Details

Summary

Avoids duplicating generated static helpers for calling convention
analysis.

This also means you can modify AArch64CallingConv.td without recompiling
the AArch64ISelLowering.cpp monolith, so it provides faster incremental
rebuilds.

Saves 12K in llc.exe, but adds a new object file, which is large.

Event Timeline

rnk created this revision.Jan 18 2019, 4:46 PM
rnk updated this revision to Diff 183172.Jan 23 2019, 2:00 PM
  • refactor ARM too
  • update new files for new license
rnk updated this revision to Diff 183173.Jan 23 2019, 2:01 PM
  • Remove unrelated change from diff

Ping? I plan to commit the ARM side separately with an updated patch description, but I put it here so it's easier to see that both backends are updated.
+@craig.topper who reviewed the x86 version of this.

rnk added a comment.Jan 28 2019, 1:20 PM

This seems like a size-saving NFC change, so I'm going to rebase, test, and land this. Let me know if you have any concerns post commit.

This revision was not accepted when it landed; it landed in state Needs Review.Jan 28 2019, 1:28 PM
This revision was automatically updated to reflect the committed changes.
pcc added a subscriber: pcc.Jan 31 2019, 6:27 PM
pcc added inline comments.
llvm/trunk/lib/Target/AArch64/AArch64CallingConvention.h
1 ↗(On Diff #183950)

Should this file be tblgen'erated?

Herald added a project: Restricted Project. · View Herald TranscriptJan 31 2019, 6:27 PM
rnk marked an inline comment as done.Jan 31 2019, 6:36 PM
rnk added inline comments.
llvm/trunk/lib/Target/AArch64/AArch64CallingConvention.h
1 ↗(On Diff #183950)

It could be. X86 has so few entry points, I was surprised by the way that ARM/AArch64 did things, so I didn't plan this up front. However, there's not that much incremental value to changing the way this all works, so I don't think it will make the top of my priority list.

One way to make this code less repetitive would be to use a typedef for the CC entry point function prototype and declare these like variables. Less repetitive, but also unclear. =/

typedef bool CCEntryFTy(unsigned, ...);
CCEntryFTy CC_AArch64_AAPCS;
...