[LLVMdev] The Trouble with Triples

Renato Golin renato.golin at linaro.org
Fri Jul 31 09:55:54 PDT 2015


On 31 July 2015 at 17:47, Daniel Sanders <Daniel.Sanders at imgtec.com> wrote:
> After re-reading your last couple emails with the benefit of sleep, that all makes sense to me. The user/driver would be responsible for ensuring each tool is called with the same options, while each tool is responsible for using the same TargetTuple in all its calls to LLVM. The only bit I'm unsure about w.r.t to not having a serialization in the IR is the ModuleLinker where we currently have code to ensure that all the modules are compatible (by comparing the triple). Presumably, this code was added because there was a real possibility of having incompatible modules (i.e. different triples) so we shouldn't rely on the tool options here. For this the serialization via metadata makes sense to me. We can then compare and merge TargetTuples with target-appropriate leniency and/or strictness.

Exactly. That's why I suggested to not touch the triple and to add the
rest as metadata. So that previous versions of Clang could still
compile and link new IR and vice-versa.

The triple still plays the part of the bare minimum in the new scheme,
and that's not going away. But if we have more metadata, you can have
better warnings/errors when linking IR.

Each target will be able to choose whatever they think it's
appropriate and the rest will not have to cope with attributes they
don't understand, not the bloating that this would make.

cheers,
--renato




More information about the llvm-dev mailing list