[PATCH] D31624: [AArch64][Fuchsia] Allow -mcmodel=kernel for --target=aarch64-fuchsia

Tim Northover via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 3 14:40:10 PDT 2017


t.p.northover added a comment.

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



================
Comment at: lib/Target/AArch64/AArch64FastISel.cpp:3150
   CodeModel::Model CM = TM.getCodeModel();
-  // Only support the small and large code model.
-  if (CM != CodeModel::Small && CM != CodeModel::Large)
+  // Only support the small (aka kernel) and large code model.
+  if (CM != CodeModel::Small && CM != CodeModel::Large &&
----------------
I think "aka" is a bit strong. There really is a difference, even if it doesn't affect this decision.


================
Comment at: lib/Target/AArch64/AArch64Subtarget.cpp:152-153
   // produce the value 0 (if the code is above 4GB).
-  if (TM.getCodeModel() == CodeModel::Small && GV->hasExternalWeakLinkage())
+  if ((TM.getCodeModel() == CodeModel::Small ||
+       TM.getCodeModel() == CodeModel::Kernel) &&
+      GV->hasExternalWeakLinkage())
----------------
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.


Repository:
  rL LLVM

https://reviews.llvm.org/D31624





More information about the llvm-commits mailing list