[LLVMdev] lower-lever IR (A-normal form)

Eirini _ eirini_dit at windowslive.com
Thu Jul 11 02:37:54 PDT 2013


I would like to create some tables for my instructions in the IR. For example a table that has all the store instructions.
I want all the arguments to a function or instruction or constant etc to be trivial. 
So to fix my previous example instead of having : 

 call void @llvm.memcpy.i32(i8* %19, i8* getelementptr inbounds ([2 x [2
 x [3 x i8]]]* @main.s, i32 0, i32 0, i32 0, i32 0), i32 12, i32 1) 
i would like to have in my IR the following :

%temp =  i8* getelementptr inbounds ([2 x [2 x [3 x i8]]]* @main.s, i32 0)
%temp1 =  i8* getelementptr inbounds( %temp, i32 0)
%temp2 =  i8* getelementptr inbounds (%temp1, i32 0)                                                                                 
%temp4 =  i8* getelementptr inbounds (%temp3, i32 0) 

call void @llvm.memcpy.i32(i8* %19, i8* %temp4, i32 12, i32 1)         

What i'm asking is, if LLVM can do this for me (for example with a certain flag while compiling the code) or i should break on my own these kind of expressions into simpler.      

                                                                  

Let me rephrase your question slightly. Would you be satisfied if the disassembled llvm format showed constant expressions on their own line, without turning them into instructions or changing the binary representation at all?



On Thu, Jul 11, 2013 at 4:05 AM, Eirini _ <eirini_dit at windowslive.com> wrote:




Hi,

 i would like to ask you, if i can get a lower-level representation than the llvm IR.For example, having the following instruction in the llvm IR, 
 call void @llvm.memcpy.i32(i8* %19, i8* getelementptr inbounds ([2 x [2 x [3 x i8]]]* @main.s, i32 0, i32 0, i32 0, i32 0), i32 12, i32 1)

i would like to get something like this (in A-normal form (without nested instructions):
%temp =  i8* getelementptr inbounds ([2 x [2 x [3 x i8]]]* @main.s, i32 0, i32 0, i32 0, i32 0)
 call void @llvm.memcpy.i32(i8* %19, %temp, i32 12, i32 1)


Thanks 		 	   		  

_______________________________________________

LLVM Developers mailing list

LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu

http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev



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


More information about the llvm-dev mailing list