[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 22 12:00:26 PDT 2017


On Wed, May 17, 2017 at 9:16 AM Florian Hahn via Phabricator via
llvm-commits <llvm-commits at lists.llvm.org> wrote:

> fhahn created this revision.
> Herald added subscribers: javed.absar, mehdi_amini, aemerson.
>
> This patch adds support for linking Thumb bitcode modules into ARM
> modules (and vice versa), by adding +thumb-mode to the target-features
> attribute for each function in the Thumb module (unless the function
> already
> has a thumb-mode value). By adding +thumb-mode to the functions from the
> Thumb
> module, Thumb code is generated for those functions when linked using an
> armxxx triple.
>

Perhaps the fix should be to apply the attribute on the functions in the
first place, rather than at merge time?

(& I guess there's no chance of actually removing the thumb-mode from the
target triple? (so that it's all just armxxx (with thumb as an alias for
the same) - with the only difference being the attributes on the functions
say "thumb-mode") What's in the way of that?)


>
> It also silences the different triple warning, when linking modules with
> armxxx
> and thumbxxx triples, as long as the subarch, vendor and OS match.
>
> I am not sure of IRLinker::run is the right place to add those
> attributes. Maybe we should add them at an earlier stage, e.g. during IR
> generation in Clang?
>
>
> https://reviews.llvm.org/D33287
>
> Files:
>   lib/Linker/IRMover.cpp
>   test/LTO/ARM/Inputs/thumb.ll
>   test/LTO/ARM/link-arm-and-thumb.ll
>   test/Linker/Inputs/thumb.ll
>   test/Linker/link-arm-and-thumb.ll
>
> _______________________________________________
> 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/20170522/3c13073f/attachment.html>


More information about the llvm-commits mailing list