[llvm-dev] ERROR: Constant unimplemented for type

Lucian Radu Teodorescu via llvm-dev llvm-dev at lists.llvm.org
Mon Sep 5 14:47:09 PDT 2016


I have the following code:

target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128    :128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
target triple = "x86_64-apple-macosx10.9.0"

%MyType = type { i8* }

define i32 @main(i32 %argc, i8** %argv) nounwind uwtable {
  %const.arr = alloca [8 x i8], align 8
  store [8 x i8] c"\D0\CFT\15\01\00\00\00", [8 x i8]* %const.arr
  %1 = bitcast [8 x i8]* %const.arr to %MyType*
  ret i32 0
If I compile this with "llvm-as test.llvm" and then "lli test.llvm.bc", I get no error. On the other hand, If I hit "lli -force-interpreter test.llvm.bc" I get the following error:

LLVM ERROR: ERROR: Constant unimplemented for type: [8 x i8]
Inspecting the code, I don't see anything wrong with it.

Why does the LLVM pure interpreter performs differently from the JIT-enabled interpreter with respect of array constants? (LLVM 3.8.1)
Is this behaviour intended?

Thank you very much,

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160906/f069ea15/attachment.html>

More information about the llvm-dev mailing list