Disabling ExecutionEngine tests for Hexagon

Hi There,

We want to disable all ExecutionEngine JIT/MCJIT tests (llvm/unittests/ExecutionEngine) for Hexagon. I have been looking into the test framework but haven’t quite figured out how to turn them off. We cross compile Hexagon on X86 and are not interested in JIT support.

Thanks,

Jyotsna

Hi Jyotsna,

Currently there's a preprocessor trick that prevents llvm/unittests/ExecutionEngine/MCJIT tests from running on architectures and operating systems that are known to fail.

Specifically, check out the functions OSSupportsMCJIT() and ArchSupportsMCJIT() functions in unittests/ExecutionEngine/MCJIT/MCJITTestBase.h, and the corresponding macro SKIP_UNSUPPORTED_PLATFORM that is used to 'decorate' the test cases.

I'm not sure if there's anything like that in place for JIT, but it can probably be ported over unless someone has a concern with the overall approach.

Dan

Thanks Dan!

The ArchSupportMCJIT() functions in
unittests/ExecutionEngine/MCJIT/MCJITTestBase.h uses "Host Triple" to check
for compatibility. Since we cross-compile on X86, "Host Triple" for us will
be "X86" which is a supported architecture. I tried removing it from the
supported arch list but didn't see any effect.

I was just wondering if these tests are meant to work for any of the
cross-compiled targets. If not, then we can probably enable them only when
Host and Target Triples are same and the host architecture is in the
supported list.

Thanks,
Jyotsna

Thanks Dan!

The ArchSupportMCJIT() functions in
unittests/ExecutionEngine/MCJIT/MCJITTestBase.h uses "Host Triple" to
check
for compatibility. Since we cross-compile on X86, "Host Triple" for us
will
be "X86" which is a supported architecture. I tried removing it from the
supported arch list but didn't see any effect.

Since MCJIT works on x86, please don't remove it from the supported
platforms list. One downside of using the macro trick is that the test
names are still printed even when they are disabled. It sounds like you
need to modify the macro to also check for the target triple as well...

I was just wondering if these tests are meant to work for any of the
cross-compiled targets. If not, then we can probably enable them only when
Host and Target Triples are same and the host architecture is in the
supported list.

There isn't anything in MCJIT as far as I know that prevents cross
compilation. That said, the SectionMemoryManager that's used by the unit
tests doesn't support remote execution. However, the RemoteMemoryManager
has been improving lately; it could foreseeably be used to add remote
execution support to the tests.

Since MCJIT works on x86, please don't remove it from the supported
platforms list. One downside of using the macro trick is that the test

names

are still printed even when they are disabled. It sounds like you need to
modify the macro to also check for the target triple as well...

This was just a temporary change to see how it works.

There isn't anything in MCJIT as far as I know that prevents cross

compilation.

That said, the SectionMemoryManager that's used by the unit tests doesn't
support remote execution. However, the RemoteMemoryManager has been
improving lately; it could foreseeably be used to add remote execution
support to the tests.

That explains why MCJIT test executable
(build/unittests/ExecutionEngine/MCJIT/MCJITTests) was an X86 binary in my
case. It appears to me that these tests will always fail for
cross-compilation unless modified for remote execution.

I noticed "TARGET_HAS_JIT" flag in Makefile.config. Can I use this flag to
exclude MCJIT and JIT tests when not set? This will be a simpler change than
modifying the macro.

Thanks,
Jyotsna

TARGET_HAS_JIT seems to be an autoconf thing (also, not really sure how it
works) and has no equivalent in the cmake world. If you do want to use
TARGET_HAS_JIT, please provide an equivalent for cmake users.

Will do that. Thanks!