llc instability when generating ARM code - contractor desired

Hello llvm’ers,

We are using the llvm compiler tools (llvm-link, llc, etc) to generate code for ARM for the Android NDK. We’re on a pretty tight deadline and have a host of issues that we could use some help overcoming. We’re interested in bringing on a contractor experienced in llvm to help us. Broadly, llc is giving various assertion failures while generating the native code (some examples below). Additionally, we’re seeing code generated by llc give segfaults during runtime when running the llvm-test-suite programs.

We are interested in hearing from anyone with experience in this area. Please contact Kevin Morgan at kmorgan@arxan.com or respond to me directly if you are interested.

Here are some of the issues we’re running into:

  1. Passing -disable-fp-elim to llc causes a huge number of failures in the llvm-test-suite. We get approximately a 60% pass rate. This occurs when we link llvm object files with llvm-link, then generate the code using llc. The failures are a mix of llc assertions and runtime segfaults.

  2. The following assertion failure in RegisterScavenging.cpp (using llc2.6):

llc-2.6: /home/build/3rdparty/llvm-2.6-src/lib/CodeGen/RegisterScavenging.cpp:226: void llvm::RegScavenger::forward(): Assertion `(KillRegs.test(Reg) || isUnused(Reg) || isLiveInButUnusedBefore(Reg, MI, MBB, TRI, MRI)) && “Re-defining a live register!”’ failed.
Stack dump:
0. Program arguments: /home/build/bin/llc-2.6 -O0 -regalloc=local -relocation-model=pic -f program.bc -o program.bc.s

  1. Running pass ‘Prolog/Epilog Insertion & Frame Finalization’ on function ‘@SST_Link_Remove
    Program /home/build/bin/llc-2.6 returned error code 0

  2. More assertion failures when compiling program.bc from above using llc2.7.

  3. The following assembler error message when assembling a file generated by llc2.7:
    Build/Targets/arm-android-linux/Debug/program.bc:2102864: Error: invalid constant (6b4) after fixup
    Program arm-eabi-g++ returned error code 1
    and here is the line it’s complaining about:

.set .LPCRELV133, (.LJTI8424_0_0-(.LPCRELL133+8))
.LPCRELL133:
add r0, pc, #.LPCRELV133

Sorry for the lack of detail into these issues. We’ve just begun running into these issues – very soon I’ll be generating some reduced test cases using bug-point and will give more information if/when it becomes available. Thanks for your time.

Nathan McCauley
Arxan Technologies

Hello, Nathan

2. The following assertion failure in RegisterScavenging.cpp (using llc2.6):

Use top of the tree, not LLVM 2.6, not even 2.7. ARM support is pretty
much buggy and weak in 2.7

Build/Targets/arm-android-linux/Debug/program.bc:2102864: Error: invalid
constant (6b4) after fixup
Program arm-eabi-g++ returned error code 1

Make sure you're using the latests binutils snapshot, prev. versions
are known buggy.
2.20.1 release is not enough.

These two rules should reduce the amount of problems, I'd suppose, down to zero.