[PATCH] D33287: [Linker] Add support for linking ARM and Thumb IR modules.

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Mon May 29 13:37:07 PDT 2017


On Tue, May 23, 2017 at 10:36 AM Florian Hahn via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

>
>
> On 23/05/2017 18:20, Eric Christopher wrote:
> > I think the general way I'd look at fixing this is:
> >
> > a) migrate to a single TargetMachine in the backend (you've apparently
> > got a patch out for this, but needs reviewing)
>
> Yep, https://reviews.llvm.org/D33318 but that's more of a cleanup and
> should be a NFC.
>
> > b) migrate to using thumb as a subtarget feature on every function from
> > code generation
>
> I've just put up a clang patch that should do that
> https://reviews.llvm.org/D33448
>
> > c) autoupgrade modules using a thumb triple to have the thumb attribute
> > on functions (making this patch obsolete)
>
> What would be the best place for this upgrade be? I think we still have
> to update Triple::isCompatible to allow linking armxx and thumbxx
> triples. I'll update this patch tomorrow.
>

The upgrade would be in the bitcode loader. Check the various other upgrade
paths here:

  lib/Bitcode/Reader/MetadataLoader.cpp

There shouldn't be any need for the triple to exist beyond the bitcode
reader (not sure how low level it is, whether the triple's existence could
truly be isolated to that one file - so it might not be quite that
perfect/simple). The IR linker shouldn't ever see the old triple - because
it'd be upgraded while the bitcode is being loaded.

All the existing textual IR can be updated whenever the attribute support
is in (if we're in a hybrid state of supporting both the attribute and the
triple) - mass migrating all the textual IR test cases over to the new
syntax (common triple, thumb attribute) - sed and python can be handy for
automating that process (at least in my experience).


>
> > d) ... something I'm probably forgetting.
>
> I've also put up a patch fixing a problem with mixing Thumb and ARM
> functions in a single compilation unit https://reviews.llvm.org/D33436
>
>
>
> (b) and (c) would also be a first step towards getting rid of the
> thumbxx triples, as David suggested, although thumbxx triples are
> currently the only way to specify that all functions in a compilation
> unit have +thumb-mode in the llvm binaries AFAIK.
>

Right - hence starting with the fix to add the attribute everywhere and to
upgrade the triple to attributes.


>
> IMPORTANT NOTICE: The contents of this email and any attachments are
> confidential and may also be privileged. If you are not the intended
> recipient, please notify the sender immediately and do not disclose the
> contents to any other person, use it for any purpose, or store or copy the
> information in any medium. Thank you.
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170529/11d5d56e/attachment.html>


More information about the llvm-commits mailing list