[llvm-dev] Testing "normal" cross-compilers versus GPU backends

Robinson, Paul via llvm-dev llvm-dev at lists.llvm.org
Fri Sep 4 13:36:33 PDT 2015


> > I think the default expectation for a new target is that it should
> support
> > basically all target-independent LLVM features, and there are tests for
> lots
> > of those features.  Therefore if a target fails to support something,
> the
> > owner of the target is responsible for making sure those tests are
> disabled
> > appropriately.
> 
> Is there such a documentation of what is a target independent feature that
> every backend *must* implement?

In general, you want the tests to pass. :-)

> What if I write a test with types like i3 and i1985?

A test to verify what?

> 
> My understanding, I may be wrong of course, is that the IR is generic and
> IR passes should pass on “any” generic IR (i.e. “opt” level passes).
> As soon as you introduce a backend, you lose these guarantees (i.e. “llc”
> level).

That's different from saying "anything that uses llc is necessarily
specific to only one target."  Obviously there are lots of tests in
the DebugInfo and CodeGen/Generic directories that are expected to work
for basically any target.  And nearly all of them use llc.

Lots of the things that vary across targets are encoded in DataLayout, but
that doesn't mean every test that ends up "depending" on DataLayout must
be target-specific. DataLayout exists specifically to parameterize a set
of things that are typically supported across targets.  You can easily
write tests for chunks of functionality that look at whether a couple of
addresses match, but don't actually care whether the size is 32-bit or 
64-bit or 40-bit. These are tests that "depend" on DataLayout and use llc 
but are in fact target-neutral.  By default, they should run on target X,
unless as the target-X owner you have some specific reason not to.

--paulr



More information about the llvm-dev mailing list