A question about LLVM assembly

Hello, LLVM guys.
I've tried to emit the following simple function to LLVM assmbly.

Seung Jae Lee wrote:

Hello, LLVM guys.
I've tried to emit the following simple function to LLVM assmbly.
---------------------------------------------------------
void test(long s, double* a) {
   char h = ttt(s);
  *a = s;
   mmm();
}
---------------------------------------------------------

It's spat out as follows:
---------------------------------------------------------
void %test(int %s, double* %a) {
entry:
        %tmp = cast int %s to uint ; <uint> [#uses=1]
        %tmp = tail call sbyte %ttt( uint %tmp ) ; <sbyte> [#uses=0]
        %tmp1 = cast int %s to double ; <double> [#uses=1]
        store double %tmp1, double* %a
        tail call void (...)* %mmm( )
        ret void
}
---------------------------------------------------------
I have two question as to above.

1) Clearly, the type of input 's' is 'long'. But it's emitted as 'int'. What's the reason for this?
  

The LLVM type system does not use the same names for integer types as the C type system. In your C program, the C compiler can use either the int type name or the long type name to indicate that an integer is a 32 bit signed integer value. In LLVM, there is one type name for a 32 bit signed integer value: the LLVM int.

The LLVM 2.0 type system uses names that are more clear: an 8 bit integer type is i8, a 32 bit integer type is an i32, etc.

2) As you can see in the code, mmm() does nothing in the function. However it was spat as 'tail call'.
I've read 'tail' is marked when "the callee function accesses any allocas or varargs in the caller" in the LLVM assembly language reference manual. But mmm() doesn't seem to use anything in the caller so this is why I can't figure it out.
  

What the manual says (albeit unclearly) is that the presence or absence of 'tail' indicates whether or not the callee function accesses any allocas or varargs in the caller (i.e. if tail is there, tail call elimination is possible; otherwise, tail call elimination is not possible).

We can re-word the manual to make it more clear.

-- John T.