diff options
author | Victor Hernandez <vhernandez@apple.com> | 2009-10-24 04:23:03 +0000 |
---|---|---|
committer | Victor Hernandez <vhernandez@apple.com> | 2009-10-24 04:23:03 +0000 |
commit | e297149e267e05159db4dc490493fddcb3784d95 (patch) | |
tree | 4f49152e0dfd1305070ba4ab33c516f5fe31ebab /llvm/test/Transforms | |
parent | 46ed1f83414d1e93e5af6a8145526c0d216861c1 (diff) | |
download | bcm5719-llvm-e297149e267e05159db4dc490493fddcb3784d95.tar.gz bcm5719-llvm-e297149e267e05159db4dc490493fddcb3784d95.zip |
Auto-upgrade free instructions to calls to the builtin free function.
Update all analysis passes and transforms to treat free calls just like FreeInst.
Remove RaiseAllocations and all its tests since FreeInst no longer needs to be raised.
llvm-svn: 84987
Diffstat (limited to 'llvm/test/Transforms')
5 files changed, 4 insertions, 43 deletions
diff --git a/llvm/test/Transforms/InstCombine/malloc-free-delete.ll b/llvm/test/Transforms/InstCombine/malloc-free-delete.ll index fd91e447bdd..a4b7496ef40 100644 --- a/llvm/test/Transforms/InstCombine/malloc-free-delete.ll +++ b/llvm/test/Transforms/InstCombine/malloc-free-delete.ll @@ -1,11 +1,13 @@ -; RUN: opt < %s -instcombine -S | grep {ret i32 0} -; RUN: opt < %s -instcombine -globaldce -S | not grep malloc +; RUN: opt < %s -instcombine -globaldce -S | FileCheck %s ; PR1201 define i32 @main(i32 %argc, i8** %argv) { %c_19 = alloca i8* ; <i8**> [#uses=2] %malloc_206 = malloc i8, i32 10 ; <i8*> [#uses=1] +; CHECK-NOT: malloc store i8* %malloc_206, i8** %c_19 %tmp_207 = load i8** %c_19 ; <i8*> [#uses=1] free i8* %tmp_207 +; CHECK-NOT: free ret i32 0 +; CHECK: ret i32 0 } diff --git a/llvm/test/Transforms/RaiseAllocations/2004-11-08-FreeUseCrash.ll b/llvm/test/Transforms/RaiseAllocations/2004-11-08-FreeUseCrash.ll deleted file mode 100644 index 75e02e84fac..00000000000 --- a/llvm/test/Transforms/RaiseAllocations/2004-11-08-FreeUseCrash.ll +++ /dev/null @@ -1,10 +0,0 @@ -; RUN: opt < %s -raiseallocs -disable-output - -define void @main() { - %tmp.13 = call i32 (...)* @free( i32 32 ) ; <i32> [#uses=1] - %tmp.14 = inttoptr i32 %tmp.13 to i32* ; <i32*> [#uses=0] - ret void -} - -declare i32 @free(...) - diff --git a/llvm/test/Transforms/RaiseAllocations/2007-10-17-InvokeFree.ll b/llvm/test/Transforms/RaiseAllocations/2007-10-17-InvokeFree.ll deleted file mode 100644 index 675bb3d829f..00000000000 --- a/llvm/test/Transforms/RaiseAllocations/2007-10-17-InvokeFree.ll +++ /dev/null @@ -1,17 +0,0 @@ -; RUN: opt < %s -raiseallocs -stats -disable-output |& \ -; RUN: not grep {Number of allocations raised} -define void @foo() { -entry: - %buffer = alloca i16* - %tmp = load i16** %buffer, align 8 - invoke i32(...)* @free(i16* %tmp) - to label %invcont unwind label %unwind -invcont: - br label %finally -unwind: - br label %finally -finally: - ret void -} -declare i32 @free(...) - diff --git a/llvm/test/Transforms/RaiseAllocations/FreeCastConstantExpr.ll b/llvm/test/Transforms/RaiseAllocations/FreeCastConstantExpr.ll deleted file mode 100644 index 1cf072910a6..00000000000 --- a/llvm/test/Transforms/RaiseAllocations/FreeCastConstantExpr.ll +++ /dev/null @@ -1,11 +0,0 @@ -; This situation can occur due to the funcresolve pass. -; -; RUN: opt < %s -raiseallocs -S | not grep call - -declare void @free(i8*) - -define void @test(i32* %P) { - call void bitcast (void (i8*)* @free to void (i32*)*)( i32* %P ) - ret void -} - diff --git a/llvm/test/Transforms/RaiseAllocations/dg.exp b/llvm/test/Transforms/RaiseAllocations/dg.exp deleted file mode 100644 index f2005891a59..00000000000 --- a/llvm/test/Transforms/RaiseAllocations/dg.exp +++ /dev/null @@ -1,3 +0,0 @@ -load_lib llvm.exp - -RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{ll,c,cpp}]] |