From ded64d5d348ce8d8c5aa42cf63f6de9dd84b7e89 Mon Sep 17 00:00:00 2001 From: rdivacky Date: Thu, 5 Nov 2009 17:17:44 +0000 Subject: Update LLVM to r86140. --- test/Transforms/GlobalOpt/2009-06-01-RecursivePHI.ll | 7 ++++++- test/Transforms/GlobalOpt/heap-sra-1.ll | 16 ++++++++++------ test/Transforms/GlobalOpt/heap-sra-2.ll | 14 ++++++++------ test/Transforms/GlobalOpt/heap-sra-3.ll | 14 ++++++-------- test/Transforms/GlobalOpt/heap-sra-4.ll | 14 ++++++-------- test/Transforms/GlobalOpt/heap-sra-phi.ll | 8 +++++--- test/Transforms/GlobalOpt/malloc-promote-1.ll | 9 +++++++-- test/Transforms/GlobalOpt/malloc-promote-2.ll | 8 +++++--- test/Transforms/GlobalOpt/malloc-promote-3.ll | 8 +++++--- 9 files changed, 58 insertions(+), 40 deletions(-) (limited to 'test/Transforms/GlobalOpt') diff --git a/test/Transforms/GlobalOpt/2009-06-01-RecursivePHI.ll b/test/Transforms/GlobalOpt/2009-06-01-RecursivePHI.ll index abd3109..d3c3ff5 100644 --- a/test/Transforms/GlobalOpt/2009-06-01-RecursivePHI.ll +++ b/test/Transforms/GlobalOpt/2009-06-01-RecursivePHI.ll @@ -1,4 +1,5 @@ ; RUN: opt < %s -globalopt +target datalayout = "E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128" %struct.s_annealing_sched = type { i32, float, float, float, float } %struct.s_bb = type { i32, i32, i32, i32 } @@ -96,7 +97,9 @@ bb.i34: ; preds = %bb unreachable bb1.i38: ; preds = %bb - %0 = malloc %struct.s_net, i32 undef ; <%struct.s_net*> [#uses=1] + %mallocsize = mul i64 28, undef ; [#uses=1] + %malloccall = tail call i8* @malloc(i64 %mallocsize) ; [#uses=1] + %0 = bitcast i8* %malloccall to %struct.s_net* ; <%struct.s_net*> [#uses=1] br i1 undef, label %bb.i1.i39, label %my_malloc.exit2.i bb.i1.i39: ; preds = %bb1.i38 @@ -115,3 +118,5 @@ my_malloc.exit8.i: ; preds = %my_malloc.exit2.i bb7: ; preds = %bb6.preheader unreachable } + +declare noalias i8* @malloc(i64) diff --git a/test/Transforms/GlobalOpt/heap-sra-1.ll b/test/Transforms/GlobalOpt/heap-sra-1.ll index 6df559e..9d5148f 100644 --- a/test/Transforms/GlobalOpt/heap-sra-1.ll +++ b/test/Transforms/GlobalOpt/heap-sra-1.ll @@ -1,18 +1,22 @@ -; RUN: opt < %s -globalopt -S | grep {@X.f0} -; RUN: opt < %s -globalopt -S | grep {@X.f1} -target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128" -target triple = "i386-apple-darwin7" +; RUN: opt < %s -globalopt -S | FileCheck %s +target datalayout = "E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128" %struct.foo = type { i32, i32 } @X = internal global %struct.foo* null +; CHECK: @X.f0 +; CHECK: @X.f1 -define void @bar(i32 %Size) nounwind noinline { +define void @bar(i64 %Size) nounwind noinline { entry: - %.sub = malloc %struct.foo, i32 %Size + %mallocsize = mul i64 %Size, 8 ; [#uses=1] + %malloccall = tail call i8* @malloc(i64 %mallocsize) ; [#uses=1] + %.sub = bitcast i8* %malloccall to %struct.foo* ; <%struct.foo*> [#uses=1] store %struct.foo* %.sub, %struct.foo** @X, align 4 ret void } +declare noalias i8* @malloc(i64) + define i32 @baz() nounwind readonly noinline { bb1.thread: %0 = load %struct.foo** @X, align 4 diff --git a/test/Transforms/GlobalOpt/heap-sra-2.ll b/test/Transforms/GlobalOpt/heap-sra-2.ll index 5a3c3cd1..fa8c362 100644 --- a/test/Transforms/GlobalOpt/heap-sra-2.ll +++ b/test/Transforms/GlobalOpt/heap-sra-2.ll @@ -1,20 +1,22 @@ -; RUN: opt < %s -globalopt -S | grep {@X.f0} -; RUN: opt < %s -globalopt -S | grep {@X.f1} +; RUN: opt < %s -globalopt -S | FileCheck %s +target datalayout = "E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128" -target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128" -target triple = "i386-apple-darwin7" %struct.foo = type { i32, i32 } @X = internal global %struct.foo* null ; <%struct.foo**> [#uses=2] +; CHECK: @X.f0 +; CHECK: @X.f1 define void @bar(i32 %Size) nounwind noinline { entry: - %0 = malloc [1000000 x %struct.foo] - ;%.sub = bitcast [1000000 x %struct.foo]* %0 to %struct.foo* + %malloccall = tail call i8* @malloc(i64 8000000) ; [#uses=1] + %0 = bitcast i8* %malloccall to [1000000 x %struct.foo]* ; <[1000000 x %struct.foo]*> [#uses=1] %.sub = getelementptr [1000000 x %struct.foo]* %0, i32 0, i32 0 ; <%struct.foo*> [#uses=1] store %struct.foo* %.sub, %struct.foo** @X, align 4 ret void } +declare noalias i8* @malloc(i64) + define i32 @baz() nounwind readonly noinline { bb1.thread: %0 = load %struct.foo** @X, align 4 ; <%struct.foo*> [#uses=1] diff --git a/test/Transforms/GlobalOpt/heap-sra-3.ll b/test/Transforms/GlobalOpt/heap-sra-3.ll index 1496485..cbbcdfc 100644 --- a/test/Transforms/GlobalOpt/heap-sra-3.ll +++ b/test/Transforms/GlobalOpt/heap-sra-3.ll @@ -1,24 +1,22 @@ ; RUN: opt < %s -globalopt -S | FileCheck %s - -target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128" -target triple = "i386-apple-darwin10" +target datalayout = "E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128" %struct.foo = type { i32, i32 } @X = internal global %struct.foo* null ; CHECK: @X.f0 ; CHECK: @X.f1 -define void @bar(i32 %Size) nounwind noinline { +define void @bar(i64 %Size) nounwind noinline { entry: - %mallocsize = mul i32 ptrtoint (%struct.foo* getelementptr (%struct.foo* null, i32 1) to i32), %Size, ; [#uses=1] -; CHECK: mul i32 %Size - %malloccall = tail call i8* @malloc(i32 %mallocsize) ; [#uses=1] + %mallocsize = mul i64 8, %Size, ; [#uses=1] +; CHECK: mul i64 %Size, 4 + %malloccall = tail call i8* @malloc(i64 %mallocsize) ; [#uses=1] %.sub = bitcast i8* %malloccall to %struct.foo* ; <%struct.foo*> [#uses=1] store %struct.foo* %.sub, %struct.foo** @X, align 4 ret void } -declare noalias i8* @malloc(i32) +declare noalias i8* @malloc(i64) define i32 @baz() nounwind readonly noinline { bb1.thread: diff --git a/test/Transforms/GlobalOpt/heap-sra-4.ll b/test/Transforms/GlobalOpt/heap-sra-4.ll index ae97ef1..d5a5828 100644 --- a/test/Transforms/GlobalOpt/heap-sra-4.ll +++ b/test/Transforms/GlobalOpt/heap-sra-4.ll @@ -1,24 +1,22 @@ ; RUN: opt < %s -globalopt -S | FileCheck %s - -target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128" -target triple = "i386-apple-darwin7" +target datalayout = "E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128" %struct.foo = type { i32, i32 } @X = internal global %struct.foo* null ; CHECK: @X.f0 ; CHECK: @X.f1 -define void @bar(i32 %Size) nounwind noinline { +define void @bar(i64 %Size) nounwind noinline { entry: - %mallocsize = shl i32 ptrtoint (%struct.foo* getelementptr (%struct.foo* null, i32 1) to i32), 9, ; [#uses=1] - %malloccall = tail call i8* @malloc(i32 %mallocsize) ; [#uses=1] -; CHECK: @malloc(i32 mul (i32 512 + %mallocsize = shl i64 %Size, 3 ; [#uses=1] + %malloccall = tail call i8* @malloc(i64 %mallocsize) ; [#uses=1] +; CHECK: mul i64 %Size, 4 %.sub = bitcast i8* %malloccall to %struct.foo* ; <%struct.foo*> [#uses=1] store %struct.foo* %.sub, %struct.foo** @X, align 4 ret void } -declare noalias i8* @malloc(i32) +declare noalias i8* @malloc(i64) define i32 @baz() nounwind readonly noinline { bb1.thread: diff --git a/test/Transforms/GlobalOpt/heap-sra-phi.ll b/test/Transforms/GlobalOpt/heap-sra-phi.ll index 2eba944..6188e5a 100644 --- a/test/Transforms/GlobalOpt/heap-sra-phi.ll +++ b/test/Transforms/GlobalOpt/heap-sra-phi.ll @@ -1,19 +1,21 @@ ; RUN: opt < %s -globalopt -S | grep {tmp.f1 = phi i32. } ; RUN: opt < %s -globalopt -S | grep {tmp.f0 = phi i32. } +target datalayout = "E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128" -target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128" -target triple = "i386-apple-darwin7" %struct.foo = type { i32, i32 } @X = internal global %struct.foo* null ; <%struct.foo**> [#uses=2] define void @bar(i32 %Size) nounwind noinline { entry: - %tmp = malloc [1000000 x %struct.foo] ; <[1000000 x %struct.foo]*> [#uses=1] + %malloccall = tail call i8* @malloc(i64 8000000) ; [#uses=1] + %tmp = bitcast i8* %malloccall to [1000000 x %struct.foo]* ; <[1000000 x %struct.foo]*> [#uses=1] %.sub = getelementptr [1000000 x %struct.foo]* %tmp, i32 0, i32 0 ; <%struct.foo*> [#uses=1] store %struct.foo* %.sub, %struct.foo** @X, align 4 ret void } +declare noalias i8* @malloc(i64) + define i32 @baz() nounwind readonly noinline { bb1.thread: %tmpLD1 = load %struct.foo** @X, align 4 ; <%struct.foo*> [#uses=1] diff --git a/test/Transforms/GlobalOpt/malloc-promote-1.ll b/test/Transforms/GlobalOpt/malloc-promote-1.ll index fd510e3..51ccbbd 100644 --- a/test/Transforms/GlobalOpt/malloc-promote-1.ll +++ b/test/Transforms/GlobalOpt/malloc-promote-1.ll @@ -1,19 +1,24 @@ -; RUN: opt < %s -globalopt -S | not grep global +; RUN: opt < %s -globalopt -S | FileCheck %s target datalayout = "E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128" @G = internal global i32* null ; [#uses=3] +; CHECK-NOT: global define void @init() { - %P = malloc i32 ; [#uses=1] + %malloccall = tail call i8* @malloc(i64 4) ; [#uses=1] + %P = bitcast i8* %malloccall to i32* ; [#uses=1] store i32* %P, i32** @G %GV = load i32** @G ; [#uses=1] store i32 0, i32* %GV ret void } +declare noalias i8* @malloc(i64) + define i32 @get() { %GV = load i32** @G ; [#uses=1] %V = load i32* %GV ; [#uses=1] ret i32 %V +; CHECK: ret i32 0 } diff --git a/test/Transforms/GlobalOpt/malloc-promote-2.ll b/test/Transforms/GlobalOpt/malloc-promote-2.ll index d3d2252..f989b79 100644 --- a/test/Transforms/GlobalOpt/malloc-promote-2.ll +++ b/test/Transforms/GlobalOpt/malloc-promote-2.ll @@ -1,11 +1,11 @@ ; RUN: opt < %s -globalopt -globaldce -S | not grep malloc -target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128" -target triple = "i686-apple-darwin8" +target datalayout = "E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128" @G = internal global i32* null ; [#uses=3] define void @init() { - %P = malloc i32, i32 100 ; [#uses=1] + %malloccall = tail call i8* @malloc(i64 mul (i64 100, i64 4)) ; [#uses=1] + %P = bitcast i8* %malloccall to i32* ; [#uses=1] store i32* %P, i32** @G %GV = load i32** @G ; [#uses=1] %GVe = getelementptr i32* %GV, i32 40 ; [#uses=1] @@ -13,6 +13,8 @@ define void @init() { ret void } +declare noalias i8* @malloc(i64) + define i32 @get() { %GV = load i32** @G ; [#uses=1] %GVe = getelementptr i32* %GV, i32 40 ; [#uses=1] diff --git a/test/Transforms/GlobalOpt/malloc-promote-3.ll b/test/Transforms/GlobalOpt/malloc-promote-3.ll index a920b61..57f937d 100644 --- a/test/Transforms/GlobalOpt/malloc-promote-3.ll +++ b/test/Transforms/GlobalOpt/malloc-promote-3.ll @@ -1,11 +1,11 @@ ; RUN: opt < %s -globalopt -globaldce -S | not grep malloc -target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128" -target triple = "i686-apple-darwin8" +target datalayout = "E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128" @G = internal global i32* null ; [#uses=4] define void @init() { - %P = malloc i32, i32 100 ; [#uses=1] + %malloccall = tail call i8* @malloc(i64 mul (i64 100, i64 4)) ; [#uses=1] + %P = bitcast i8* %malloccall to i32* ; [#uses=1] store i32* %P, i32** @G %GV = load i32** @G ; [#uses=1] %GVe = getelementptr i32* %GV, i32 40 ; [#uses=1] @@ -13,6 +13,8 @@ define void @init() { ret void } +declare noalias i8* @malloc(i64) + define i32 @get() { %GV = load i32** @G ; [#uses=1] %GVe = getelementptr i32* %GV, i32 40 ; [#uses=1] -- cgit v1.1