[PATCH] D33291: [ThinLTO] Do not assert when adding a module with a different but compatible target triple

Akira Hatanaka via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 17 11:00:16 PDT 2017


ahatanak created this revision.
Herald added subscribers: eraman, inglorion, Prazek.

Currently, an assertion fails in ThinLTOCodeGenerator::addModule when the target triple of the module being added doesn't match that of the one stored in TMBuilder. This patch relaxes the constraint and makes changes to allow target triples that only differ in their version numbers on Apple platforms, similarly to what r228999 did.

Note that this patch only checks whether the target triples of the modules are compatible, but doesn't do anything to change the target triple in the IR when different but compatible triples are seen. Should we overwrite the triples in the IR so that they are identical to the one in TargetMachine? If the answer is yes, where or when should that happen?

rdar://problem/30133904


https://reviews.llvm.org/D33291

Files:
  include/llvm/ADT/Triple.h
  lib/LTO/ThinLTOCodeGenerator.cpp
  lib/Linker/IRMover.cpp
  lib/Support/Triple.cpp
  test/ThinLTO/X86/Inputs/merge-triple.ll
  test/ThinLTO/X86/merge-triple.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D33291.99328.patch
Type: text/x-patch
Size: 6097 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170517/58311523/attachment.bin>


More information about the llvm-commits mailing list