Comment 6 for bug 513735

Revision history for this message
Xerxes RĂ„nby (xranby) wrote :

I fill in the bits i know about the llvm jit.

The llvm jit output armv4t code unless the JIT ExecutionEngine have been instructed that the host cpu supports anything better.
Currently there dont exist any code in the llvm execution engine arm target backend to automatically determine the host cpu capabilities.

The JIT can be tuned by projects using the LLVM JIT (like openjdk shark) by passing some command line options using the
cl::ParseCommandLineOptions(args.size() - 1, (char **) &args[0]);
defined in
#include <llvm/Support/CommandLine.h>

the available tuning options are:
-mtriple=arm-gnu-eabi-linux currently used by the llvm arm backend to switch between thumb only and arm mode.
for thumb only mode then specify a triple that start with the thumb keyword instead of arm.
-mcpu=
tunes the generated code for various cpu models and automatically enables cpu attributes
examples of cpus to specify are

 arm1020e - Select the arm1020e processor.
 arm1020t - Select the arm1020t processor.
 arm1022e - Select the arm1022e processor.
 arm10e - Select the arm10e processor.
 arm10tdmi - Select the arm10tdmi processor.
 arm1136j-s - Select the arm1136j-s processor.
 arm1136jf-s - Select the arm1136jf-s processor.
 arm1156t2-s - Select the arm1156t2-s processor.
 arm1156t2f-s - Select the arm1156t2f-s processor.
 arm1176jz-s - Select the arm1176jz-s processor.
 arm1176jzf-s - Select the arm1176jzf-s processor.
 arm710t - Select the arm710t processor.
 arm720t - Select the arm720t processor.
 arm7tdmi - Select the arm7tdmi processor.
 arm7tdmi-s - Select the arm7tdmi-s processor.
 arm8 - Select the arm8 processor.
 arm810 - Select the arm810 processor.
 arm9 - Select the arm9 processor.
 arm920 - Select the arm920 processor.
 arm920t - Select the arm920t processor.
 arm922t - Select the arm922t processor.
 arm926ej-s - Select the arm926ej-s processor.
 arm940t - Select the arm940t processor.
 arm946e-s - Select the arm946e-s processor.
 arm966e-s - Select the arm966e-s processor.
 arm968e-s - Select the arm968e-s processor.
 arm9e - Select the arm9e processor.
 arm9tdmi - Select the arm9tdmi processor.
 cortex-a8 - Select the cortex-a8 processor.
 cortex-a9 - Select the cortex-a9 processor.
 ep9312 - Select the ep9312 processor.
 generic - Select the generic processor.
 iwmmxt - Select the iwmmxt processor.
 mpcore - Select the mpcore processor.
 mpcorenovfp - Select the mpcorenovfp processor.
 strongarm - Select the strongarm processor.
 strongarm110 - Select the strongarm110 processor.
 strongarm1100 - Select the strongarm1100 processor.
 strongarm1110 - Select the strongarm1110 processor.
 xscale - Select the xscale processor.

-mattr=
manually set cpu features
Available features for this target:

 neon - Enable NEON instructions.
 neonfp - Use NEON for single-precision FP.
 thumb2 - Enable Thumb2 instructions.
 v4t - ARM v4T.
 v5t - ARM v5T.
 v5te - ARM v5TE, v5TEj, v5TExp.
 v6 - ARM v6.
 v6t2 - ARM v6t2.
 v7a - ARM v7A.
 vfp2 - Enable VFP2 instructions.
 vfp3 - Enable VFP3 instructions.

Use +feature to enable a feature, or -feature to disable it.
For example, lli -mcpu=mycpu -mattr=+feature1,-feature2

==============%<===============================================
ok to cut a long story short....

i compiled the llvm trunk using the two pops for __thumb__ instead of one big one and then tried the llvm regression testsuite by running make check
...
  === Summary ===

# of expected passes 2884
# of unexpected failures 37
# of expected failures 19
make[1]: *** [check-local] Error 1
make[1]: Leaving directory `/wd/llvm-configure/test'
make: *** [check] Error 2

its soo broken! unexpected failures should be 0 not 37.
and about all failures happened when running the ExecutionEngine (JIT) tests.

ok good news are that all the failures looks the same:
Running /wd/llvm/test/ExecutionEngine/dg.exp ...
FAIL: /wd/llvm/test/ExecutionEngine/2002-12-16-ArgTest.ll
Failed with signal(SIGABRT) at line 2
while running: lli 2002-12-16-ArgTest.ll.tmp.bc > /dev/null
Unhandled instruction encoding format!
UNREACHABLE executed at /wd/llvm/lib/Target/ARM/ARMCodeEmitter.cpp:313!
Stack dump:
0. Program arguments: lli 2002-12-16-ArgTest.ll.tmp.bc
1. Running pass 'ARM Machine Code Emitter' on function '@main'

FAIL: /wd/llvm/test/ExecutionEngine/2003-01-04-ArgumentBug.ll
Failed with signal(SIGABRT) at line 2
while running: lli 2003-01-04-ArgumentBug.ll.tmp.bc > /dev/null
Unhandled instruction encoding format!
UNREACHABLE executed at /wd/llvm/lib/Target/ARM/ARMCodeEmitter.cpp:313!
Stack dump:
0. Program arguments: lli 2003-01-04-ArgumentBug.ll.tmp.bc
1. Running pass 'ARM Machine Code Emitter' on function '@main'
...