gamma_chen
2013-Apr-12 06:41 UTC
[LLVMdev] What pattern of front end language can be tranalated into
I find this pattern as below from <llvm-source-tree>/test/CodeGen/Mips/alloca.ll, and want to know what front end pattern can be translated into this. Anybody know this answer? %tmp1 = alloca i8, i32 %size, align 4 // has %size variable, not pattern, alloca i8, align 4 define i32 @twoalloca(i32 %size) nounwind { entry: ... %tmp1 = alloca i8, i32 %size, align 4 } Jonathan -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130412/f43c87ef/attachment.html>
Duncan Sands
2013-Apr-12 07:28 UTC
[LLVMdev] What pattern of front end language can be tranalated into
Hi Jonathan, On 12/04/13 08:41, gamma_chen wrote:> I find this pattern as below from > <llvm-source-tree>/test/CodeGen/Mips/alloca.ll, and want to know what front end > pattern can be translated into this. Anybody know this answer? > > %tmp1 = alloca i8, i32 %size, align 4 // has %size variable, not pattern, alloca > i8, align 4 > > define i32 @twoalloca(i32 %size) nounwind { > entry: > ... > %tmp1 = alloca i8, i32 %size, align 4 > }for example, the following code: void use(char *); void foo(long size) { char A[size]; use(A); } -> define void @foo(i64 %size) unnamed_addr #0 { entry: %0 = alloca i8, i64 %size, align 16 call void @use(i8* %0) #1 ret void } declare void @use(i8*) attributes #0 = { nounwind uwtable } attributes #1 = { nounwind } Ciao, Duncan.