Page MenuHomePhabricator

[lld-macho] Add support for -mcpu, -mattr, -code-model in LTO
ClosedPublic

Authored by int3 on Dec 8 2020, 10:28 PM.

Details

Summary

-mcpu and -code-model tests were copied from similar ones in
LLD-ELF.

There doesn't seem to be an equivalent test for -mattr in LLD-ELF, so
I've verified our behavior by cribbing a test from
CodeGen/X86/recip-fastmath.ll.

Diff Detail

Event Timeline

int3 created this revision.Dec 8 2020, 10:28 PM
int3 requested review of this revision.Dec 8 2020, 10:28 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 8 2020, 10:28 PM
compnerd accepted this revision.Dec 9 2020, 8:28 AM
compnerd added a subscriber: compnerd.

I wonder if there is a good way to enumerate the desired set of options (e.g. -O is currently missing), but I don't think that there have been too many attempts to flesh out the argument handling, so we can hold off on that until we find that we have had to do this a few times.

This revision is now accepted and ready to land.Dec 9 2020, 8:28 AM
MaskRay accepted this revision.Dec 9 2020, 9:11 AM
MaskRay added a subscriber: MaskRay.

Maybe time to add lto/ or use the lto- prefix?

int3 added a comment.Dec 9 2020, 1:53 PM

Maybe time to add lto/ or use the lto- prefix?

I think the .ll extension is pretty much only used for LTO test cases, so it seems a bit redundant to add another prefix...

I wonder if there is a good way to enumerate the desired set of options

I don't understand what you mean by "enumerate" here... could you elaborate?

int3 updated this revision to Diff 310679.Dec 9 2020, 3:12 PM
int3 retitled this revision from [lld-macho] Add support for -code-model in LTO to [lld-macho] Add support for -mcpu, -mattr, -code-model in LTO.
int3 edited the summary of this revision. (Show Details)

merge other LTO diffs

This revision was landed with ongoing or failed builds.Dec 10 2020, 3:58 PM
This revision was automatically updated to reflect the committed changes.

Looks like this breaks tests on mac and windows: http://45.33.8.238/mac/25017/step_10.txt