<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Wed, May 17, 2017 at 9:16 AM Florian Hahn via Phabricator via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">fhahn created this revision.<br>
Herald added subscribers: javed.absar, mehdi_amini, aemerson.<br>
<br>
This patch adds support for linking Thumb bitcode modules into ARM<br>
modules (and vice versa), by adding +thumb-mode to the target-features<br>
attribute for each function in the Thumb module (unless the function already<br>
has a thumb-mode value). By adding +thumb-mode to the functions from the Thumb<br>
module, Thumb code is generated for those functions when linked using an<br>
armxxx triple.<br></blockquote><div><br>Perhaps the fix should be to apply the attribute on the functions in the first place, rather than at merge time?<br><br>(& 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?)<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
It also silences the different triple warning, when linking modules with armxxx<br>
and thumbxxx triples, as long as the subarch, vendor and OS match.<br>
<br>
I am not sure of IRLinker::run is the right place to add those<br>
attributes. Maybe we should add them at an earlier stage, e.g. during IR<br>
generation in Clang?<br>
<br>
<br>
<a href="https://reviews.llvm.org/D33287" rel="noreferrer" target="_blank">https://reviews.llvm.org/D33287</a><br>
<br>
Files:<br>
  lib/Linker/IRMover.cpp<br>
  test/LTO/ARM/Inputs/thumb.ll<br>
  test/LTO/ARM/link-arm-and-thumb.ll<br>
  test/Linker/Inputs/thumb.ll<br>
  test/Linker/link-arm-and-thumb.ll<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div></div>