[llvm-commits] [poolalloc] r114624 - in /poolalloc/trunk/test/dsa/local: bitfields1.bc bitfields1.c bitfields1.ll bitfields2.c bitfields2.ll

Arushi Aggarwal aggarwa4 at illinois.edu
Wed Sep 22 21:13:03 PDT 2010


Author: aggarwa4
Date: Wed Sep 22 23:13:03 2010
New Revision: 114624

URL: http://llvm.org/viewvc/llvm-project?rev=114624&view=rev
Log:
 Some tests for offsets/types for bitfields

Added:
    poolalloc/trunk/test/dsa/local/bitfields1.bc   (with props)
    poolalloc/trunk/test/dsa/local/bitfields1.c
    poolalloc/trunk/test/dsa/local/bitfields1.ll
    poolalloc/trunk/test/dsa/local/bitfields2.c
    poolalloc/trunk/test/dsa/local/bitfields2.ll

Added: poolalloc/trunk/test/dsa/local/bitfields1.bc
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/dsa/local/bitfields1.bc?rev=114624&view=auto
==============================================================================
Binary file - no diff available.

Propchange: poolalloc/trunk/test/dsa/local/bitfields1.bc
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: poolalloc/trunk/test/dsa/local/bitfields1.c
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/dsa/local/bitfields1.c?rev=114624&view=auto
==============================================================================
--- poolalloc/trunk/test/dsa/local/bitfields1.c (added)
+++ poolalloc/trunk/test/dsa/local/bitfields1.c Wed Sep 22 23:13:03 2010
@@ -0,0 +1,24 @@
+#include <stdio.h>
+
+typedef union {
+        struct {
+                signed int immed:16;
+                unsigned int rt:5;
+                unsigned int rs:5;
+                unsigned int rf:5;
+                unsigned int opcode:6;
+        };
+        unsigned int w;
+} I_format_t;
+
+ 
+int main()
+{
+        I_format_t *ia = (I_format_t *)malloc(sizeof(I_format_t));
+        ia->w = 0xAFBE0010;
+        printf("\ninstruction: %X\n",ia->w);
+        printf("opcode: %X\n",ia->opcode);
+        printf("rs: %d rt: %d rj: %d \n", ia->rs, ia->rt, ia->rf);
+        printf("immed: %d\n",ia->immed);
+        return 0;
+}

Added: poolalloc/trunk/test/dsa/local/bitfields1.ll
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/dsa/local/bitfields1.ll?rev=114624&view=auto
==============================================================================
--- poolalloc/trunk/test/dsa/local/bitfields1.ll (added)
+++ poolalloc/trunk/test/dsa/local/bitfields1.ll Wed Sep 22 23:13:03 2010
@@ -0,0 +1,92 @@
+
+;RUN: dsaopt %s -dsa-local -analyze -check-type=main:ia:0,0:i16|i32::4:i8
+
+; ModuleID = 'bitfields1.bc'
+target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
+target triple = "x86_64-unknown-linux-gnu"
+
+%struct.anon = type <{ i16, i16, i8, [3 x i8] }>
+%union.I_format_t = type { i32, [1 x i32] }
+
+ at .str = private constant [18 x i8] c"\0Ainstruction: %X\0A\00", align 1 ; <[18 x i8]*> [#uses=1]
+ at .str1 = private constant [12 x i8] c"opcode: %X\0A\00", align 1 ; <[12 x i8]*> [#uses=1]
+ at .str2 = private constant [23 x i8] c"rs: %d rt: %d rj: %d \0A\00", align 1 ; <[23 x i8]*> [#uses=1]
+ at .str3 = private constant [11 x i8] c"immed: %d\0A\00", align 1 ; <[11 x i8]*> [#uses=1]
+
+define i32 @main() nounwind {
+entry:
+  %retval = alloca i32                            ; <i32*> [#uses=2]
+  %0 = alloca i32                                 ; <i32*> [#uses=2]
+  %ia = alloca %union.I_format_t*                 ; <%union.I_format_t**> [#uses=8]
+  %"alloca point" = bitcast i32 0 to i32          ; <i32> [#uses=0]
+  %1 = call noalias i8* @malloc(i64 8) nounwind   ; <i8*> [#uses=1]
+  %2 = bitcast i8* %1 to %union.I_format_t*       ; <%union.I_format_t*> [#uses=1]
+  store %union.I_format_t* %2, %union.I_format_t** %ia, align 8
+  %3 = load %union.I_format_t** %ia, align 8      ; <%union.I_format_t*> [#uses=1]
+  %4 = getelementptr inbounds %union.I_format_t* %3, i32 0, i32 0 ; <i32*> [#uses=1]
+  store i32 -1346502640, i32* %4, align 4
+  %5 = load %union.I_format_t** %ia, align 8      ; <%union.I_format_t*> [#uses=1]
+  %6 = getelementptr inbounds %union.I_format_t* %5, i32 0, i32 0 ; <i32*> [#uses=1]
+  %7 = load i32* %6, align 4                      ; <i32> [#uses=1]
+  %8 = call i32 (i8*, ...)* @printf(i8* noalias getelementptr inbounds ([18 x i8]* @.str, i64 0, i64 0), i32 %7) nounwind ; <i32> [#uses=0]
+  %9 = load %union.I_format_t** %ia, align 8      ; <%union.I_format_t*> [#uses=1]
+  %10 = getelementptr inbounds %union.I_format_t* %9, i32 0, i32 0 ; <i32*> [#uses=1]
+  %11 = bitcast i32* %10 to %struct.anon*         ; <%struct.anon*> [#uses=1]
+  %12 = getelementptr inbounds %struct.anon* %11, i32 0, i32 2 ; <i8*> [#uses=1]
+  %13 = load i8* %12, align 1                     ; <i8> [#uses=1]
+  %14 = shl i8 %13, 2                             ; <i8> [#uses=1]
+  %15 = lshr i8 %14, 2                            ; <i8> [#uses=1]
+  %16 = trunc i8 %15 to i6                        ; <i6> [#uses=1]
+  %17 = zext i6 %16 to i32                        ; <i32> [#uses=1]
+  %18 = call i32 (i8*, ...)* @printf(i8* noalias getelementptr inbounds ([12 x i8]* @.str1, i64 0, i64 0), i32 %17) nounwind ; <i32> [#uses=0]
+  %19 = load %union.I_format_t** %ia, align 8     ; <%union.I_format_t*> [#uses=1]
+  %20 = getelementptr inbounds %union.I_format_t* %19, i32 0, i32 0 ; <i32*> [#uses=1]
+  %21 = bitcast i32* %20 to %struct.anon*         ; <%struct.anon*> [#uses=1]
+  %22 = getelementptr inbounds %struct.anon* %21, i32 0, i32 0 ; <i16*> [#uses=1]
+  %23 = bitcast i16* %22 to i32*                  ; <i32*> [#uses=1]
+  %24 = load i32* %23, align 1                    ; <i32> [#uses=1]
+  %25 = shl i32 %24, 1                            ; <i32> [#uses=1]
+  %26 = lshr i32 %25, 27                          ; <i32> [#uses=1]
+  %27 = trunc i32 %26 to i5                       ; <i5> [#uses=1]
+  %28 = zext i5 %27 to i32                        ; <i32> [#uses=1]
+  %29 = load %union.I_format_t** %ia, align 8     ; <%union.I_format_t*> [#uses=1]
+  %30 = getelementptr inbounds %union.I_format_t* %29, i32 0, i32 0 ; <i32*> [#uses=1]
+  %31 = bitcast i32* %30 to %struct.anon*         ; <%struct.anon*> [#uses=1]
+  %32 = getelementptr inbounds %struct.anon* %31, i32 0, i32 0 ; <i16*> [#uses=1]
+  %33 = bitcast i16* %32 to i32*                  ; <i32*> [#uses=1]
+  %34 = load i32* %33, align 1                    ; <i32> [#uses=1]
+  %35 = shl i32 %34, 11                           ; <i32> [#uses=1]
+  %36 = lshr i32 %35, 27                          ; <i32> [#uses=1]
+  %37 = trunc i32 %36 to i5                       ; <i5> [#uses=1]
+  %38 = zext i5 %37 to i32                        ; <i32> [#uses=1]
+  %39 = load %union.I_format_t** %ia, align 8     ; <%union.I_format_t*> [#uses=1]
+  %40 = getelementptr inbounds %union.I_format_t* %39, i32 0, i32 0 ; <i32*> [#uses=1]
+  %41 = bitcast i32* %40 to %struct.anon*         ; <%struct.anon*> [#uses=1]
+  %42 = getelementptr inbounds %struct.anon* %41, i32 0, i32 0 ; <i16*> [#uses=1]
+  %43 = bitcast i16* %42 to i32*                  ; <i32*> [#uses=1]
+  %44 = load i32* %43, align 1                    ; <i32> [#uses=1]
+  %45 = shl i32 %44, 6                            ; <i32> [#uses=1]
+  %46 = lshr i32 %45, 27                          ; <i32> [#uses=1]
+  %47 = trunc i32 %46 to i5                       ; <i5> [#uses=1]
+  %48 = zext i5 %47 to i32                        ; <i32> [#uses=1]
+  %49 = call i32 (i8*, ...)* @printf(i8* noalias getelementptr inbounds ([23 x i8]* @.str2, i64 0, i64 0), i32 %48, i32 %38, i32 %28) nounwind ; <i32> [#uses=0]
+  %50 = load %union.I_format_t** %ia, align 8     ; <%union.I_format_t*> [#uses=1]
+  %51 = getelementptr inbounds %union.I_format_t* %50, i32 0, i32 0 ; <i32*> [#uses=1]
+  %52 = bitcast i32* %51 to %struct.anon*         ; <%struct.anon*> [#uses=1]
+  %53 = getelementptr inbounds %struct.anon* %52, i32 0, i32 0 ; <i16*> [#uses=1]
+  %54 = load i16* %53, align 1                    ; <i16> [#uses=1]
+  %55 = sext i16 %54 to i32                       ; <i32> [#uses=1]
+  %56 = call i32 (i8*, ...)* @printf(i8* noalias getelementptr inbounds ([11 x i8]* @.str3, i64 0, i64 0), i32 %55) nounwind ; <i32> [#uses=0]
+  store i32 0, i32* %0, align 4
+  %57 = load i32* %0, align 4                     ; <i32> [#uses=1]
+  store i32 %57, i32* %retval, align 4
+  br label %return
+
+return:                                           ; preds = %entry
+  %retval1 = load i32* %retval                    ; <i32> [#uses=1]
+  ret i32 %retval1
+}
+
+declare noalias i8* @malloc(i64) nounwind
+
+declare i32 @printf(i8* noalias, ...) nounwind

Added: poolalloc/trunk/test/dsa/local/bitfields2.c
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/dsa/local/bitfields2.c?rev=114624&view=auto
==============================================================================
--- poolalloc/trunk/test/dsa/local/bitfields2.c (added)
+++ poolalloc/trunk/test/dsa/local/bitfields2.c Wed Sep 22 23:13:03 2010
@@ -0,0 +1,39 @@
+#include <stdio.h>
+
+typedef union {
+	struct {
+		unsigned int fn:6;
+		unsigned int sh:5;
+		unsigned int rd:5;
+	};
+	struct {
+		signed int immed:16;
+		unsigned int rt:5;
+		unsigned int rs:5;
+		unsigned int opcode:6;
+	};
+	unsigned int w;
+} mips_format_t;
+
+
+int main()
+{
+	int i;
+	mips_format_t ia;
+	unsigned int codes[] = {0x27bdffe8, 0xAFBE0010, 0x03A0F021, 0x2402000E};
+	int n = sizeof(codes)/sizeof(int);
+	for (i=0; i<n; i++) {
+		ia.w = codes[i];
+		printf("\ninstruction: %X\n",ia.w);
+		printf("opcode: %X\n",ia.opcode);
+		printf("rs: %d rt: %d\n", ia.rs, ia.rt);
+		if (ia.opcode==0) {
+			printf("rd: %d  sh: %d  fn: %X\n",ia.rd,ia.sh,ia.fn);
+		}
+		else {
+			printf("immed: %d\n",ia.immed);
+		}
+	}
+	return 0;
+}
+

Added: poolalloc/trunk/test/dsa/local/bitfields2.ll
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/dsa/local/bitfields2.ll?rev=114624&view=auto
==============================================================================
--- poolalloc/trunk/test/dsa/local/bitfields2.ll (added)
+++ poolalloc/trunk/test/dsa/local/bitfields2.ll Wed Sep 22 23:13:03 2010
@@ -0,0 +1,152 @@
+
+;RUN: dsaopt %s -dsa-local -analyze -check-type=main:codes,0:i32Array
+;RUN: dsaopt %s -dsa-local -analyze -check-type=main:ia,0:i16|i32
+
+; ModuleID = 'bitfields2.bc'
+target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
+target triple = "x86_64-unknown-linux-gnu"
+
+%0 = type <{ i16, i16 }>
+%struct.anon = type <{ i16, [2 x i8] }>
+%union.mips_format_t = type { i32 }
+
+ at C.0.1960 = private constant [4 x i32] [i32 666763240, i32 -1346502640, i32 60878881, i32 604110862] ; <[4 x i32]*> [#uses=4]
+ at .str = private constant [18 x i8] c"\0Ainstruction: %X\0A\00", align 1 ; <[18 x i8]*> [#uses=1]
+ at .str1 = private constant [12 x i8] c"opcode: %X\0A\00", align 1 ; <[12 x i8]*> [#uses=1]
+ at .str2 = private constant [15 x i8] c"rs: %d rt: %d\0A\00", align 1 ; <[15 x i8]*> [#uses=1]
+ at .str3 = private constant [24 x i8] c"rd: %d  sh: %d  fn: %X\0A\00", align 1 ; <[24 x i8]*> [#uses=1]
+ at .str4 = private constant [11 x i8] c"immed: %d\0A\00", align 1 ; <[11 x i8]*> [#uses=1]
+
+define i32 @main() nounwind {
+entry:
+  %retval = alloca i32                            ; <i32*> [#uses=2]
+  %0 = alloca i32                                 ; <i32*> [#uses=2]
+  %i = alloca i32                                 ; <i32*> [#uses=5]
+  %ia = alloca %union.mips_format_t               ; <%union.mips_format_t*> [#uses=10]
+  %codes = alloca [4 x i32]                       ; <[4 x i32]*> [#uses=5]
+  %n = alloca i32                                 ; <i32*> [#uses=2]
+  %"alloca point" = bitcast i32 0 to i32          ; <i32> [#uses=0]
+  %1 = getelementptr inbounds [4 x i32]* %codes, i32 0, i32 0 ; <i32*> [#uses=1]
+  %2 = load i32* getelementptr inbounds ([4 x i32]* @C.0.1960, i64 0, i64 0), align 4 ; <i32> [#uses=1]
+  store i32 %2, i32* %1, align 4
+  %3 = getelementptr inbounds [4 x i32]* %codes, i32 0, i32 1 ; <i32*> [#uses=1]
+  %4 = load i32* getelementptr inbounds ([4 x i32]* @C.0.1960, i64 0, i64 1), align 4 ; <i32> [#uses=1]
+  store i32 %4, i32* %3, align 4
+  %5 = getelementptr inbounds [4 x i32]* %codes, i32 0, i32 2 ; <i32*> [#uses=1]
+  %6 = load i32* getelementptr inbounds ([4 x i32]* @C.0.1960, i64 0, i64 2), align 4 ; <i32> [#uses=1]
+  store i32 %6, i32* %5, align 4
+  %7 = getelementptr inbounds [4 x i32]* %codes, i32 0, i32 3 ; <i32*> [#uses=1]
+  %8 = load i32* getelementptr inbounds ([4 x i32]* @C.0.1960, i64 0, i64 3), align 4 ; <i32> [#uses=1]
+  store i32 %8, i32* %7, align 4
+  store i32 4, i32* %n, align 4
+  store i32 0, i32* %i, align 4
+  br label %bb4
+
+bb:                                               ; preds = %bb4
+  %9 = load i32* %i, align 4                      ; <i32> [#uses=1]
+  %10 = sext i32 %9 to i64                        ; <i64> [#uses=1]
+  %11 = getelementptr inbounds [4 x i32]* %codes, i64 0, i64 %10 ; <i32*> [#uses=1]
+  %12 = load i32* %11, align 4                    ; <i32> [#uses=1]
+  %13 = getelementptr inbounds %union.mips_format_t* %ia, i32 0, i32 0 ; <i32*> [#uses=1]
+  store i32 %12, i32* %13, align 4
+  %14 = getelementptr inbounds %union.mips_format_t* %ia, i32 0, i32 0 ; <i32*> [#uses=1]
+  %15 = load i32* %14, align 4                    ; <i32> [#uses=1]
+  %16 = call i32 (i8*, ...)* @printf(i8* noalias getelementptr inbounds ([18 x i8]* @.str, i64 0, i64 0), i32 %15) nounwind ; <i32> [#uses=0]
+  %17 = getelementptr inbounds %union.mips_format_t* %ia, i32 0, i32 0 ; <i32*> [#uses=1]
+  %18 = bitcast i32* %17 to %0*                   ; <%0*> [#uses=1]
+  %19 = getelementptr inbounds %0* %18, i32 0, i32 0 ; <i16*> [#uses=1]
+  %20 = bitcast i16* %19 to i32*                  ; <i32*> [#uses=1]
+  %21 = load i32* %20, align 1                    ; <i32> [#uses=1]
+  %22 = lshr i32 %21, 26                          ; <i32> [#uses=1]
+  %23 = trunc i32 %22 to i6                       ; <i6> [#uses=1]
+  %24 = zext i6 %23 to i32                        ; <i32> [#uses=1]
+  %25 = call i32 (i8*, ...)* @printf(i8* noalias getelementptr inbounds ([12 x i8]* @.str1, i64 0, i64 0), i32 %24) nounwind ; <i32> [#uses=0]
+  %26 = getelementptr inbounds %union.mips_format_t* %ia, i32 0, i32 0 ; <i32*> [#uses=1]
+  %27 = bitcast i32* %26 to %0*                   ; <%0*> [#uses=1]
+  %28 = getelementptr inbounds %0* %27, i32 0, i32 0 ; <i16*> [#uses=1]
+  %29 = bitcast i16* %28 to i32*                  ; <i32*> [#uses=1]
+  %30 = load i32* %29, align 1                    ; <i32> [#uses=1]
+  %31 = shl i32 %30, 11                           ; <i32> [#uses=1]
+  %32 = lshr i32 %31, 27                          ; <i32> [#uses=1]
+  %33 = trunc i32 %32 to i5                       ; <i5> [#uses=1]
+  %34 = zext i5 %33 to i32                        ; <i32> [#uses=1]
+  %35 = getelementptr inbounds %union.mips_format_t* %ia, i32 0, i32 0 ; <i32*> [#uses=1]
+  %36 = bitcast i32* %35 to %0*                   ; <%0*> [#uses=1]
+  %37 = getelementptr inbounds %0* %36, i32 0, i32 0 ; <i16*> [#uses=1]
+  %38 = bitcast i16* %37 to i32*                  ; <i32*> [#uses=1]
+  %39 = load i32* %38, align 1                    ; <i32> [#uses=1]
+  %40 = shl i32 %39, 6                            ; <i32> [#uses=1]
+  %41 = lshr i32 %40, 27                          ; <i32> [#uses=1]
+  %42 = trunc i32 %41 to i5                       ; <i5> [#uses=1]
+  %43 = zext i5 %42 to i32                        ; <i32> [#uses=1]
+  %44 = call i32 (i8*, ...)* @printf(i8* noalias getelementptr inbounds ([15 x i8]* @.str2, i64 0, i64 0), i32 %43, i32 %34) nounwind ; <i32> [#uses=0]
+  %45 = getelementptr inbounds %union.mips_format_t* %ia, i32 0, i32 0 ; <i32*> [#uses=1]
+  %46 = bitcast i32* %45 to %0*                   ; <%0*> [#uses=1]
+  %47 = getelementptr inbounds %0* %46, i32 0, i32 0 ; <i16*> [#uses=1]
+  %48 = bitcast i16* %47 to i32*                  ; <i32*> [#uses=1]
+  %49 = load i32* %48, align 1                    ; <i32> [#uses=1]
+  %50 = lshr i32 %49, 26                          ; <i32> [#uses=1]
+  %51 = trunc i32 %50 to i6                       ; <i6> [#uses=1]
+  %52 = icmp eq i6 %51, 0                         ; <i1> [#uses=1]
+  br i1 %52, label %bb1, label %bb2
+
+bb1:                                              ; preds = %bb
+  %53 = getelementptr inbounds %union.mips_format_t* %ia, i32 0, i32 0 ; <i32*> [#uses=1]
+  %54 = bitcast i32* %53 to %struct.anon*         ; <%struct.anon*> [#uses=1]
+  %55 = getelementptr inbounds %struct.anon* %54, i32 0, i32 0 ; <i16*> [#uses=1]
+  %56 = load i16* %55, align 1                    ; <i16> [#uses=1]
+  %57 = shl i16 %56, 10                           ; <i16> [#uses=1]
+  %58 = lshr i16 %57, 10                          ; <i16> [#uses=1]
+  %59 = trunc i16 %58 to i6                       ; <i6> [#uses=1]
+  %60 = zext i6 %59 to i32                        ; <i32> [#uses=1]
+  %61 = getelementptr inbounds %union.mips_format_t* %ia, i32 0, i32 0 ; <i32*> [#uses=1]
+  %62 = bitcast i32* %61 to %struct.anon*         ; <%struct.anon*> [#uses=1]
+  %63 = getelementptr inbounds %struct.anon* %62, i32 0, i32 0 ; <i16*> [#uses=1]
+  %64 = load i16* %63, align 1                    ; <i16> [#uses=1]
+  %65 = shl i16 %64, 5                            ; <i16> [#uses=1]
+  %66 = lshr i16 %65, 11                          ; <i16> [#uses=1]
+  %67 = trunc i16 %66 to i5                       ; <i5> [#uses=1]
+  %68 = zext i5 %67 to i32                        ; <i32> [#uses=1]
+  %69 = getelementptr inbounds %union.mips_format_t* %ia, i32 0, i32 0 ; <i32*> [#uses=1]
+  %70 = bitcast i32* %69 to %struct.anon*         ; <%struct.anon*> [#uses=1]
+  %71 = getelementptr inbounds %struct.anon* %70, i32 0, i32 0 ; <i16*> [#uses=1]
+  %72 = load i16* %71, align 1                    ; <i16> [#uses=1]
+  %73 = lshr i16 %72, 11                          ; <i16> [#uses=1]
+  %74 = trunc i16 %73 to i5                       ; <i5> [#uses=1]
+  %75 = zext i5 %74 to i32                        ; <i32> [#uses=1]
+  %76 = call i32 (i8*, ...)* @printf(i8* noalias getelementptr inbounds ([24 x i8]* @.str3, i64 0, i64 0), i32 %75, i32 %68, i32 %60) nounwind ; <i32> [#uses=0]
+  br label %bb3
+
+bb2:                                              ; preds = %bb
+  %77 = getelementptr inbounds %union.mips_format_t* %ia, i32 0, i32 0 ; <i32*> [#uses=1]
+  %78 = bitcast i32* %77 to %0*                   ; <%0*> [#uses=1]
+  %79 = getelementptr inbounds %0* %78, i32 0, i32 0 ; <i16*> [#uses=1]
+  %80 = load i16* %79, align 1                    ; <i16> [#uses=1]
+  %81 = sext i16 %80 to i32                       ; <i32> [#uses=1]
+  %82 = call i32 (i8*, ...)* @printf(i8* noalias getelementptr inbounds ([11 x i8]* @.str4, i64 0, i64 0), i32 %81) nounwind ; <i32> [#uses=0]
+  br label %bb3
+
+bb3:                                              ; preds = %bb2, %bb1
+  %83 = load i32* %i, align 4                     ; <i32> [#uses=1]
+  %84 = add nsw i32 %83, 1                        ; <i32> [#uses=1]
+  store i32 %84, i32* %i, align 4
+  br label %bb4
+
+bb4:                                              ; preds = %bb3, %entry
+  %85 = load i32* %i, align 4                     ; <i32> [#uses=1]
+  %86 = load i32* %n, align 4                     ; <i32> [#uses=1]
+  %87 = icmp slt i32 %85, %86                     ; <i1> [#uses=1]
+  br i1 %87, label %bb, label %bb5
+
+bb5:                                              ; preds = %bb4
+  store i32 0, i32* %0, align 4
+  %88 = load i32* %0, align 4                     ; <i32> [#uses=1]
+  store i32 %88, i32* %retval, align 4
+  br label %return
+
+return:                                           ; preds = %bb5
+  %retval6 = load i32* %retval                    ; <i32> [#uses=1]
+  ret i32 %retval6
+}
+
+declare i32 @printf(i8* noalias, ...) nounwind





More information about the llvm-commits mailing list