[LLVMdev] something wrong with .ll file?

fima rabin fimarn at yahoo.com
Wed Jan 6 14:11:09 PST 2010


Here is my .td definition in IntrinsicsMymachine.td


let TargetPrefix = "mymachine" in {  // 
 def int_mymachine_su_route :
              Intrinsic<[llvm_void_ty], [llvm_i32_ty,
                         llvm_i32_ty], [IntrNoMem]>;
}


-- fima


----- Original Message ----
From: Bill Wendling <wendling at apple.com>
To: fima rabin <fimarn at yahoo.com>
Cc: llvmdev at cs.uiuc.edu
Sent: Wed, January 6, 2010 4:54:16 PM
Subject: Re: [LLVMdev] something wrong with .ll file?

On Jan 6, 2010, at 1:12 PM, fima rabin wrote:

> I am trying to compile a little intrinsic function for my machine. Here is a dump from clang-cc with --emit-llvm option:
> =====================
> 
> ; ModuleID = 'foo.c'
> target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32"
> target triple = "i386-pc-linux-gnu"
> 
> @main.i = internal global i32 0                   ; <i32*> [#uses=0]
> @main.x = internal global [10 x float] zeroinitializer ; <[10 x float]*> [#uses=0]
> @main.y = internal global [10 x float] zeroinitializer ; <[10 x float]*> [#uses=0]
> 
> define i32 @main() nounwind {
> entry:
>  %retval = alloca i32                            ; <i32*> [#uses=2]
>  %m1 = alloca <2 x double>, align 16             ; <<2 x double>*> [#uses=0]
>  %m2 = alloca <2 x double>, align 16             ; <<2 x double>*> [#uses=0]
>  %j = alloca i32, align 4                        ; <i32*> [#uses=0]
>  store i32 0, i32* %retval
>  call void @llvm.mymachine.su.route(i32 5, i32 4)
>  %0 = load i32* %retval                          ; <i32> [#uses=1]
>  ret i32 %0
> }
> 
> declare void @llvm.mymachine.su.route(i32, i32) nounwind readnone
> 
> ===========================================
> 
> As you can see, the intrinsic function takes two integer arguments and does not
> return anything.
> 
> For some reason I am getting into trouble when I use llc to process my .bc file. In visitTargetIntrinsic()
> the second argument to function ComputeValueVTs() -  I.getType() == llvm::Type::VoidTyID. This leads me to
> the exception: "Cannot have nodes without results!".
> 
> Is there is something wrong with my byte code or  I messed up somewhere in llc code?
> 
> Are there any other dumps that I can use while processing .bc file?
> 
What's the TD definition of your intrinsic?

-bw


      



More information about the llvm-dev mailing list