[LLVMdev] Is this value an integer type?

Török Edwin edwintorok at gmail.com
Mon May 17 07:07:39 PDT 2010


On 05/17/2010 05:02 PM, Zheng Wang wrote:
> Hello,
> 
> I have a problem of dumping a value. Here is the llvm assembly code:
> 
> ---
>  %322 = getelementptr inbounds [76 x [4 x i8]]* @i_tc0_table, i32 0,
> i32 %305, i32 %321 ; <i8*> [#uses=1]
>  %323 = load i8* %322, align 1                   ; <i8> [#uses=1]
>  store i8 %323, i8* %89, align 1
> --
> 
> I want to dump %323 to a library function whose prototype is:
> 
> recordStore(const char*, unsigned int, unsigned, int)

To pass an i8 as i32 you need either sign-, or zero-extension, i.e.
%324 = zext i8 %323 to i32
call %recordStore(null, %324, i32 0)

For example.
> ***** Why %323  is different from the Integer type I has declared?

i8 and i32 are different types


Best regards,
--Edwin



More information about the llvm-dev mailing list