[PATCH] D49673: [AArch64] Add Tiny Code Model for AArch64

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 16 08:53:35 PDT 2018


peter.smith added a comment.

>From what I can see, it should just be the InitialExec model that does a LOADgot which should match the GCC behaviour with respect to TLS; so I'm happy with that for this patch. I think we can add better support for tiny code model TLS later if there is a need for it. I don't have any more comments myself, if there are no other comments from the other reviewers by the end of the week I'll LGTM.



================
Comment at: lib/Target/AArch64/AArch64ISelLowering.cpp:4073
+  assert((Subtarget->useSmallAddressing() ||
+          getTargetMachine().getCodeModel() == CodeModel::Tiny) &&
          "ELF TLS only supported in small memory model");
----------------
dmgreen wrote:
> peter.smith wrote:
> > I think that this should be a user-visible error message as it is not obvious to a user why TLS might not be supported.
> > 
> > Another possibility is to just warn and use the small code model for TLS. This would cause problems for people that must avoid ADRP due to position independent requirements on 4k page alignment, but I think that could be a small minority of people.
> I agree the behaviour here for Large isn't so great. It will assert, or just use the small code here in release builds without asserts. I've changed that to a fatal error.
> 
> I'm not sure how to add a warning for tiny+tls.
Ok. Probably worth just adding a comment/FIXME that the tiny code model uses the small code model TLS sequences and that some optimization is possible.


https://reviews.llvm.org/D49673





More information about the llvm-commits mailing list