This is an archive of the discontinued LLVM Phabricator instance.

[TM] Start collapsing LLVMTargetMachine into TargetMachine
AbandonedPublic

Authored by davide on May 14 2016, 8:33 PM.

Details

Summary

As already discussed in the review that lead to the removal of the CppBackend, it seems to be a good idea to merge LLVMTargetMachine and TargetMachine together. This patch is a first step, hopefully correct.
To put things into perspective, this work is (at least partly) motivated by the desire to make TargetMachine thread-safe, so that we can simplify the splitCodeGen() logic currently used by LTO. While the two projects may be considered orthogonal, I prefer to tackle this yak shaving.

Diff Detail

Event Timeline

davide updated this revision to Diff 57291.May 14 2016, 8:33 PM
davide retitled this revision from to [TM] Start collapsing LLVMTargetMachine into TargetMachine.
davide updated this object.
davide added reviewers: rafael, echristo, jyknight.
davide added a subscriber: llvm-commits.
rafael edited edge metadata.May 16 2016, 8:58 AM

Given the library dependencies I would assume the final version has to live in lib/CodeGen, no?

lib/Target/TargetMachine.cpp
151

Can you change this to be non-virtual now?

davide added inline comments.May 16 2016, 1:24 PM
lib/Target/TargetMachine.cpp
151

Not entirely sure because PPC and Hexagon still override that? Can we somehow avoid it?

../lib/Target/PowerPC/PPCTargetMachine.h:48:42: error: only virtual member functions can be marked 'override'
  TargetIRAnalysis getTargetIRAnalysis() override;
                                         ^~~~~~~~
davide planned changes to this revision.Jun 9 2016, 8:49 AM

This one currently breaks SHARED_LIBS. I'll try to get back to this soon.

davide abandoned this revision.Sep 9 2016, 2:11 PM