This is an archive of the discontinued LLVM Phabricator instance.

Add nominal support for 'shave' target.
ClosedPublic

Authored by dougk on Jun 15 2015, 7:57 AM.

Details

Summary

This change passes through C and assembler jobs to Movidius tools by generating commands which are the same as the ones produces by the sample Makefiles included in the SDK.
Rather than reference MV_TOOLS_DIR to find executable programs, we will assume that the tools are installed in the same place where the Clang driver would find its own tools.
Similarly, this change assume that -I options will "just work" in terms of finding files.

Diff Detail

Repository
rL LLVM

Event Timeline

dougk updated this revision to Diff 27673.Jun 15 2015, 7:57 AM
dougk retitled this revision from to Add nominal support for 'shave' target..
dougk updated this object.
dougk edited the test plan for this revision. (Show Details)
dougk added a reviewer: chandlerc.
dougk added a subscriber: Unknown Object (MLST).
dougk updated this revision to Diff 27680.Jun 15 2015, 9:16 AM

Inherit from Generic_GCC instead of ToolChain.
The Generic_GCC ctor appends getDriver().getInstalledDir() into getProgramPaths() which we need, and I see no downside to this.

dougk updated this revision to Diff 27684.Jun 15 2015, 10:00 AM

Don't drop -iquote,-isystem paths, add new tests.

joerg added a subscriber: joerg.Jun 15 2015, 12:01 PM
joerg added inline comments.
lib/Driver/Driver.cpp
1572 ↗(On Diff #27684)

Unrelated?

lib/Driver/ToolChains.cpp
3748 ↗(On Diff #27684)

No need to make those out of line?

chandlerc edited edge metadata.Jun 15 2015, 12:50 PM

I agree with Joerg about submitting the separate cleanup change separately (feel free to just pull it out and commit it).

More detailed comments below.

lib/Driver/ToolChains.h
875–877 ↗(On Diff #27680)

I'm not a huge fan of the "Movi" prefix. Maybe just "Movidius" or "SHAVE"? If this is only used for the shave-* triples, I'd probably go with SHAVE.

I would also suffix it with ToolChain or something. It's not about Clang, its about the toolchain. (The use of 'GCC' here is because GCC actually ships a complete toolchain)

895–896 ↗(On Diff #27680)

I suspect these should be named MoviCompile and MoviAsm. I would also probably call these "Compiler" and "Assembler" because I'm a bit of a pedant. ;]

lib/Driver/Tools.h
734–735 ↗(On Diff #27680)

Similar to the above, I'd probably call this SHAVE given that some of the ones above are XCore.

dougk added inline comments.Jun 17 2015, 7:32 AM
lib/Driver/Driver.cpp
1572 ↗(On Diff #27684)

committed separately

lib/Driver/ToolChains.cpp
3748 ↗(On Diff #27684)

Seems these can be omitted. Since SHAVEToolChain inherits from Generic_GCC, it finds methods for isBlahDefault() and printVerboseInfo(). Is that OK?

lib/Driver/ToolChains.h
875–877 ↗(On Diff #27680)

SHAVEToolChain is fine with me. But Hexagon abbreviates to Hexagon_TC, and XCore uses no suffix. We should standardize on _TC or ToolChain. Which?

895–896 ↗(On Diff #27680)

Sure, but it introduces gratuitous inconsistency.

I also liked Compiler and Assembler except that Generic_GCC names its member variables 'Preprocess' and 'Compile' rather than 'Preprocessor' and 'Compiler'.

And the method to make an instance of tool model is tools::gcc::Preprocess (respectively tools::gcc::Compile). Those are highly un-mnemonic. They really sound like they mean *do* that job, but what they mean is "give me a thing that does that job".

And while we're on the subject, anything named someToolChain::Assemble::ConstructJob should be renamed to someToolChain::Assembler::ConstructJob, and the same for all other tools.

lib/Driver/Tools.h
734–735 ↗(On Diff #27680)

done

dougk updated this revision to Diff 27838.Jun 17 2015, 8:07 AM
dougk edited edge metadata.

Changes as requested by Joerg/Chandler.

This revision was automatically updated to reflect the committed changes.