This is an archive of the discontinued LLVM Phabricator instance.

[AArch64][Fuchsia] Allow -mcmodel=kernel for --target=aarch64-fuchsia
ClosedPublic

Authored by mcgrathr on Apr 3 2017, 1:18 PM.

Details

Diff Detail

Repository
rL LLVM

Event Timeline

mcgrathr created this revision.Apr 3 2017, 1:18 PM

This seems to be changing behaviour outside TPIDR_EL0, but only that gets tested so we probably need more tests of normal operation.

lib/Target/AArch64/AArch64FastISel.cpp
3150 ↗(On Diff #93933)

I think "aka" is a bit strong. There really is a difference, even if it doesn't affect this decision.

lib/Target/AArch64/AArch64Subtarget.cpp
152–153 ↗(On Diff #93933)

It might be an idea to put this in a function like useSmallAddressing (or whatever bikeshed you prefer) that checks the triple too. Kernel mode seems like something reasonable kernels could disagree over.

The intent is no changes whatosever except for using TPIDR_EL1.
All the other changes are just to accept CodeModel::Kernel and treat it exactly like CodeModel::Small. Do you see something where other behavior changes under -code-model=kernel?
Since before this change, -code-model=kernel was disallowed altogether and now it's allowed only for aarch64-fuchsia where it is the same as =small in almost all regards, the "aka small" comment seems correct to me.

I will make the change to consolidate the logic into a helper function.

Do you see something where other behavior changes under -code-model=kernel?

The behaviour change is that kernel is now supported as a mode. We want tests to make sure no-one goes in and decides that they want their kernel to use large addressing (for example) without getting told off when they run "ninja check". Adding tests might well be as simple as putting a new RUN line in an existing test of globals that also passes "-code-model=kernel".

it is the same as =small in almost all regards, the "aka small" comment seems correct to me.

IMO "aka" implies complete identity.

mcgrathr updated this revision to Diff 93964.Apr 3 2017, 4:11 PM

Added useSmallAddressing() helper method.

mcgrathr updated this revision to Diff 93968.Apr 3 2017, 4:19 PM

Added test runs using -mtriple=aarch64-fuchsia -code-model=kernel.

I think I've addressed all the requests. Please take another look.

t.p.northover accepted this revision.Apr 3 2017, 7:19 PM

Thanks Roland, this looks fine to me now.

This revision is now accepted and ready to land.Apr 3 2017, 7:19 PM
This revision was automatically updated to reflect the committed changes.