Covnert tests to not use indexed load/stores
authorChris Lattner <sabre@nondot.org>
Thu, 22 Aug 2002 16:04:03 +0000 (16:04 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 22 Aug 2002 16:04:03 +0000 (16:04 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3454 91177308-0d34-0410-b5e6-96231b3b80d8

test/Feature/globalvars.ll
test/Feature/recursivetype.ll
test/Feature/testalloca.ll
test/Feature/testmemory.ll

index b243ba58d8ca61e53c89247644ed8dc1929d1d96..a01c20b234d761192c0bca442122ba42fbc875d2 100644 (file)
@@ -12,7 +12,8 @@ implementation
 int "foo"(int %blah)
 begin
        store int 5, int *%MyVar
-       store int 12, { \2 *, int } * %MyIntList, uint 0, ubyte 1
+       %idx = getelementptr { \2 *, int } * %MyIntList, uint 0, ubyte 1
+       store int 12, int* %idx
        ret int %blah
 end
 
index 60ffc510d510ef87092e0aed81ec25a4921ed633..9e16e2c360e2d4182e1d80a84b9c7cbd9aed578b 100644 (file)
@@ -88,7 +88,8 @@ bb3:
         ret %list* null
 
 bb4:
-        %reg111 = load %list* %reg115, uint 0, ubyte 1                  ;;<int>
+       %idx = getelementptr %list* %reg115, uint 0, ubyte 1                  ;;<int>
+        %reg111 = load int* %idx
         %cond1013 = setne int %reg111, %Data                    ;;<bool>
         br bool %cond1013, label %bb6, label %bb5
 
@@ -96,6 +97,7 @@ bb5:
         ret %list* %reg115
 
 bb6:
-        %reg116 = load %list* %reg115, uint 0, ubyte 0                  ;;<%list*>
+       %idx2 = getelementptr %list* %reg115, uint 0, ubyte 0                  ;;<%list*>
+        %reg116 = load %list** %idx2
         br label %bb2
 end
index 9e074ced9083fcf69a2f82d3f445b0c689ccef3d..cf54743dc70282923031d591c713cf2bf07dd826 100644 (file)
@@ -13,7 +13,8 @@ begin
     %sptr = alloca %struct                  ; yields {%struct*}:sptr
     %nsptr = getelementptr %struct * %sptr, uint 0, ubyte 1  ; yields {inners*}:nsptr
     %ubsptr = getelementptr %inners * %nsptr, uint 0, ubyte 1  ; yields {{ubyte}*}:ubsptr
-    store ubyte 4, {ubyte} * %ubsptr, uint 0, ubyte 0
+    %idx = getelementptr {ubyte} * %ubsptr, uint 0, ubyte 0
+    store ubyte 4, ubyte* %idx
     
     %fptr = getelementptr %struct * %sptr, uint 0, ubyte 1, ubyte 0  ; yields {float*}:fptr
     store float 4.0, float * %fptr
index b2cf0518cc3491e246c2c51299004ab694d1b116..f46dca1bb221e8556f6fd9149de682d1851d97f2 100644 (file)
@@ -16,14 +16,16 @@ begin
     %array1 = malloc ubyte, uint 4          ; yields {ubyte*}:array1
     %array2 = malloc ubyte, uint %size      ; yields {ubyte*}:array2
 
-    store ubyte 123, [4 x ubyte]* %array0, uint 0, uint 2
+    %idx = getelementptr [4 x ubyte]* %array0, uint 0, uint 2
+    store ubyte 123, ubyte* %idx
     free [4x ubyte]* %array0
     free ubyte* %array1
     free ubyte* %array2
 
 
     %aa = alloca %complexty, uint 5
-    store sbyte *null, %complexty* %aa, uint %i0, ubyte 1, ubyte 0, uint %j0
+    %idx2 = getelementptr %complexty* %aa, uint %i0, ubyte 1, ubyte 0, uint %j0
+    store sbyte *null, sbyte** %idx2
     
     %ptr = alloca int                       ; yields {int*}:ptr
     store int 3, int* %ptr                  ; yields {void}
@@ -31,7 +33,8 @@ begin
 
     %sptr = alloca %struct                  ; yields {%struct*}:sptr
     %ubsptr = getelementptr %struct * %sptr, uint 0, ubyte 1, ubyte 1  ; yields {{ubyte}*}:ubsptr
-    store ubyte 4, {ubyte} * %ubsptr, uint 0, ubyte 0
+    %idx3 = getelementptr {ubyte} * %ubsptr, uint 0, ubyte 0
+    store ubyte 4, ubyte* %idx3
 
     ret int 3
 end