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

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 17 09:16:44 PDT 2017


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.

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D33287.99317.patch
Type: text/x-patch
Size: 4680 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170517/0509cd2b/attachment.bin>


More information about the llvm-commits mailing list