[LLVMdev] What does LLVM ERROR: Cannot select.. mean?

Roman Kennke rkennke at redhat.com
Mon Dec 3 15:07:55 PST 2012


Hello,

I am currently working on Shark, a backend for the Hotspot VM of
OpenJDK, which uses LLVM to generate target machine code.

I am currently running into an LLVM error message, and I don't know
exactly what it means or what I am doing wrong:

LLVM ERROR: Cannot select: 0x7ffff01295d0: f32,ch = AtomicLoad
0x7fffcc071b10:1, 0x7fffcc041e70<Volatile LD4[%addr29](align=8)>
[ORD=48] [ID=18]
  0x7fffcc041e70: i64 = add 0x7fffcc071b10, 0x7ffff012a2e0 [ORD=46]
[ID=17]
    0x7fffcc071b10: i64,ch = load 0x7ffff0129de0:1, 0x7fffcc042270,
0x7ffff01298d0<LD8[%109]> [ORD=45] [ID=15]
      0x7fffcc042270: i64 = add 0x7fffcc041d70, 0x7ffff012a0e0 [ORD=43]
[ID=10]
        0x7fffcc041d70: i64,ch = CopyFromReg 0x7ffff00f26f0,
0x7ffff012a1e0 [ORD=37] [ID=9]
          0x7ffff012a1e0: i64 = Register %vreg41 [ORD=37] [ID=1]
        0x7ffff012a0e0: i64 = Constant<48> [ORD=43] [ID=6]
      0x7ffff01298d0: i64 = undef [ORD=39] [ID=3]
    0x7ffff012a2e0: i64 = Constant<204> [ORD=46] [ID=7]
In function: Test6796786::main

I suspect it is related to the implementation of Shark's volatile field
access, as it's the only place where I use AtomicLoad, but as I said, I
don't know how to parse this error message. I am pretty sure that
volatile field access works otherwise, Shark can run a great number of
fairly complex application and testsuites, in particular the
java-concurrency-torture which exercises atomics fairly hard. Any help
would be greatly appreciated.

I am working with latest LLVM from the 3.2 branch, on an amd64 machine
(my laptop) and turned off all optimizations. The full LLVM code of the
function in question can be found here:

http://pastebin.com/efT9Eh5Z

(ignore the first few lines, they are the other methods that are
compiled by this testcase.)

Regards,
Roman





More information about the llvm-dev mailing list