Upgrade intrinsic function calls manually.
authorReid Spencer <rspencer@reidspencer.com>
Sat, 2 Dec 2006 20:41:53 +0000 (20:41 +0000)
committerReid Spencer <rspencer@reidspencer.com>
Sat, 2 Dec 2006 20:41:53 +0000 (20:41 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32137 91177308-0d34-0410-b5e6-96231b3b80d8

test/CodeGen/Alpha/2005-07-12-TwoMallocCalls.ll
test/CodeGen/X86/2004-02-12-Memcpy.llx
test/Transforms/GlobalOpt/memcpy.ll
test/Transforms/InstCombine/call-intrinsics.ll
test/Transforms/SimplifyLibCalls/MemCpy.ll
test/Transforms/SimplifyLibCalls/MemMove.ll

index eb5c6d911d3a53e5edd242c016c900c206ddf04a..1761d5d0e75bf65d8fe64a58a6b227218efbe380 100644 (file)
@@ -3,7 +3,7 @@
 
 implementation   ; Functions:
 
-declare void %llvm.memset(sbyte*, ubyte, ulong, uint)
+declare void %llvm.memset.i64(sbyte*, ubyte, ulong, uint)
 
 bool %l12_l94_bc_divide_endif_2E_3_2E_ce(int* %tmp.71.reload, uint %scale2.1.3, uint %extra.0, %typedef.bc_struct* %n1, %typedef.bc_struct* %n2, int* %tmp.92.reload, uint %tmp.94.reload, int* %tmp.98.reload, uint %tmp.100.reload, sbyte** %tmp.112.out, uint* %tmp.157.out, sbyte** %tmp.158.out) {
 newFuncRoot:
@@ -12,6 +12,6 @@ newFuncRoot:
        %tmp.123 = add uint %tmp.122, %tmp.100.reload           ; <uint> [#uses=2]
        %tmp.112 = malloc sbyte, uint %tmp.123          ; <sbyte*> [#uses=3]
        %tmp.137 = cast uint %tmp.123 to ulong          ; <ulong> [#uses=1]
-       tail call void %llvm.memset( sbyte* %tmp.112, ubyte 0, ulong %tmp.137, uint 0 )
+       tail call void %llvm.memset.i64( sbyte* %tmp.112, ubyte 0, ulong %tmp.137, uint 0 )
        ret bool true
 }
index ab403432585b39aa43cc291a0e37fa577069f681..8cd9a50cbb365f63a972b3c99e0b8919e036e0c3 100644 (file)
@@ -1,5 +1,5 @@
 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep movs
-declare sbyte* %llvm.memcpy(sbyte* %A, sbyte* %B, uint %amt, uint %align)
+declare void %llvm.memcpy.i32(sbyte* %A, sbyte* %B, uint %amt, uint %align)
 
 %A = global [1000 x int] zeroinitializer
 %B = global [1000 x int] zeroinitializer
@@ -7,17 +7,17 @@ declare sbyte* %llvm.memcpy(sbyte* %A, sbyte* %B, uint %amt, uint %align)
 
 void %main() {
   ; dword copy
-  call sbyte* %llvm.memcpy(sbyte* cast (int* getelementptr ([1000 x int]* %A, long 0, long 0) to sbyte*),
+  call void %llvm.memcpy.i32(sbyte* cast (int* getelementptr ([1000 x int]* %A, long 0, long 0) to sbyte*),
                            sbyte* cast (int* getelementptr ([1000 x int]* %B, long 0, long 0) to sbyte*),
                            uint 4000, uint 4)
 
   ; word copy
-  call sbyte* %llvm.memcpy(sbyte* cast (int* getelementptr ([1000 x int]* %A, long 0, long 0) to sbyte*),
+  call void %llvm.memcpy.i32(sbyte* cast (int* getelementptr ([1000 x int]* %A, long 0, long 0) to sbyte*),
                            sbyte* cast (int* getelementptr ([1000 x int]* %B, long 0, long 0) to sbyte*),
                            uint 4000, uint 2)
 
   ; byte copy
-  call sbyte* %llvm.memcpy(sbyte* cast (int* getelementptr ([1000 x int]* %A, long 0, long 0) to sbyte*),
+  call void %llvm.memcpy.i32(sbyte* cast (int* getelementptr ([1000 x int]* %A, long 0, long 0) to sbyte*),
                            sbyte* cast (int* getelementptr ([1000 x int]* %B, long 0, long 0) to sbyte*),
                            uint 4000, uint 1)
   ret void
index 253aaec63139945b3721b708c1774baf696ebf30..2d0659ba4e234257ee969b89268167d8ed66a0ed 100644 (file)
@@ -4,12 +4,12 @@
 
 implementation
 
-declare void %llvm.memcpy(sbyte*, sbyte*, uint, uint)
+declare void %llvm.memcpy.i32(sbyte*, sbyte*, uint, uint)
 
 void %foo() {
         %Blah = alloca [58 x sbyte]             ; <[58 x sbyte]*> [#uses=2]
         %tmp.0 = getelementptr [58 x sbyte]* %Blah, int 0, int 0                ; <sbyte*> [#uses=1]
-        call void %llvm.memcpy( sbyte* %tmp.0, sbyte* getelementptr ([58 x sbyte]* %G1, int 0, int 0), uint 58, uint 1 )
+        call void %llvm.memcpy.i32( sbyte* %tmp.0, sbyte* getelementptr ([58 x sbyte]* %G1, int 0, int 0), uint 58, uint 1 )
        ret void
 }
 
index df042022fbf1a5303860563908955df30915b51c..e8549981e1de45b79687813526ef505952adac57 100644 (file)
@@ -1,17 +1,17 @@
 ; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis
 
-declare void %llvm.memmove(sbyte*, sbyte*, uint, uint)
-declare void %llvm.memcpy(sbyte*, sbyte*, uint, uint)
-declare void %llvm.memset(sbyte*, ubyte, uint, uint)
+declare void %llvm.memmove.i32(sbyte*, sbyte*, uint, uint)
+declare void %llvm.memcpy.i32(sbyte*, sbyte*, uint, uint)
+declare void %llvm.memset.i32(sbyte*, ubyte, uint, uint)
 
 %X = global sbyte 0
 %Y = global sbyte 12
 
 void %zero_byte_test() {
   ; These process zero bytes, so they are a noop.
-  call void %llvm.memmove(sbyte* %X, sbyte* %Y, uint 0, uint 100)
-  call void %llvm.memcpy(sbyte* %X, sbyte* %Y, uint 0, uint 100)
-  call void %llvm.memset(sbyte* %X, ubyte 123, uint 0, uint 100)
+  call void %llvm.memmove.i32(sbyte* %X, sbyte* %Y, uint 0, uint 100)
+  call void %llvm.memcpy.i32(sbyte* %X, sbyte* %Y, uint 0, uint 100)
+  call void %llvm.memset.i32(sbyte* %X, ubyte 123, uint 0, uint 100)
   ret void
 }
 
index a127fd329f0a5cc96bf86bbc643502b39f13f662..6cc43733a1a26f7a64d1d7154c9b304065c23b03 100644 (file)
@@ -1,8 +1,8 @@
 ; Test that the StrCatOptimizer works correctly
 ; RUN: llvm-upgrade < %s | llvm-as | opt -constprop -simplify-libcalls -disable-output &&
-; RUN: llvm-upgrade < %s | llvm-as | opt -constprop -simplify-libcalls | llvm-dis | not grep 'call.*llvm.memcpy'
+; RUN: llvm-upgrade < %s | llvm-as | opt -constprop -simplify-libcalls | llvm-dis | not grep 'call.*llvm.memcpy.i32'
 
-declare sbyte* %llvm.memcpy(sbyte*,sbyte*,int,int)
+declare void %llvm.memcpy.i32(sbyte*,sbyte*,uint,uint)
 %h = constant [2 x sbyte] c"h\00"
 %hel = constant [4 x sbyte] c"hel\00"
 %hello_u = constant [8 x sbyte] c"hello_u\00"
@@ -15,8 +15,8 @@ int %main () {
   %hello_u_p = getelementptr [8 x sbyte]* %hello_u, int 0, int 0
   %target = alloca [1024 x sbyte]
   %target_p = getelementptr [1024 x sbyte]* %target, int 0, int 0
-  call sbyte* %llvm.memcpy(sbyte* %target_p, sbyte* %h_p, int 2, int 2)
-  call sbyte* %llvm.memcpy(sbyte* %target_p, sbyte* %hel_p, int 4, int 4)
-  call sbyte* %llvm.memcpy(sbyte* %target_p, sbyte* %hello_u_p, int 8, int 8)
+  call void %llvm.memcpy.i32(sbyte* %target_p, sbyte* %h_p, uint 2, uint 2)
+  call void %llvm.memcpy.i32(sbyte* %target_p, sbyte* %hel_p, uint 4, uint 4)
+  call void %llvm.memcpy.i32(sbyte* %target_p, sbyte* %hello_u_p, uint 8, uint 8)
   ret int 0
 }
index a114438921f4a598da9153c91a4374f1b3e9582c..3e6e8bd75b4b0574ce262facf491e03a332f7b60 100644 (file)
@@ -1,8 +1,8 @@
 ; Test that the StrCatOptimizer works correctly
 ; RUN: llvm-upgrade < %s | llvm-as | opt -constprop -simplify-libcalls -disable-output &&
-; RUN: llvm-upgrade < %s | llvm-as | opt -constprop -simplify-libcalls | llvm-dis | not grep 'call.*llvm.memmove'
+; RUN: llvm-upgrade < %s | llvm-as | opt -constprop -simplify-libcalls | llvm-dis | not grep 'call.*llvm.memmove.i32'
 
-declare sbyte* %llvm.memmove(sbyte*,sbyte*,int,int)
+declare void %llvm.memmove.i32(sbyte*,sbyte*,uint,uint)
 %h = constant [2 x sbyte] c"h\00"
 %hel = constant [4 x sbyte] c"hel\00"
 %hello_u = constant [8 x sbyte] c"hello_u\00"
@@ -15,8 +15,8 @@ int %main () {
   %hello_u_p = getelementptr [8 x sbyte]* %hello_u, int 0, int 0
   %target = alloca [1024 x sbyte]
   %target_p = getelementptr [1024 x sbyte]* %target, int 0, int 0
-  call sbyte* %llvm.memmove(sbyte* %target_p, sbyte* %h_p, int 2, int 2)
-  call sbyte* %llvm.memmove(sbyte* %target_p, sbyte* %hel_p, int 4, int 4)
-  call sbyte* %llvm.memmove(sbyte* %target_p, sbyte* %hello_u_p, int 8, int 8)
+  call void %llvm.memmove.i32(sbyte* %target_p, sbyte* %h_p, uint 2, uint 2)
+  call void %llvm.memmove.i32(sbyte* %target_p, sbyte* %hel_p, uint 4, uint 4)
+  call void %llvm.memmove.i32(sbyte* %target_p, sbyte* %hello_u_p, uint 8, uint 8)
   ret int 0
 }