diff options
author | Victor Hernandez <vhernandez@apple.com> | 2009-11-10 08:32:25 +0000 |
---|---|---|
committer | Victor Hernandez <vhernandez@apple.com> | 2009-11-10 08:32:25 +0000 |
commit | 8e345a1c418608c49abb7c51a090bbb36f1273bc (patch) | |
tree | 224be4ee8cbfb0f87c72ee7964af0fa7b06aeea0 /test/Analysis | |
parent | 2b6705f5e7c7624bd7fe486298c400f1afc15f6c (diff) | |
download | llvm-8e345a1c418608c49abb7c51a090bbb36f1273bc.tar.gz llvm-8e345a1c418608c49abb7c51a090bbb36f1273bc.tar.bz2 llvm-8e345a1c418608c49abb7c51a090bbb36f1273bc.tar.xz |
Update computeArraySize() to use ComputeMultiple() to determine the array size associated with a malloc; also extend PerformHeapAllocSRoA() to check if the optimized malloc's arg had its highest bit set, so that it is safe for ComputeMultiple() to look through sext instructions while determining the optimized malloc's array size
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86676 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Analysis')
-rw-r--r-- | test/Analysis/PointerTracking/sizes.ll | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/test/Analysis/PointerTracking/sizes.ll b/test/Analysis/PointerTracking/sizes.ll index 267c3b83e2..c8ca648e87 100644 --- a/test/Analysis/PointerTracking/sizes.ll +++ b/test/Analysis/PointerTracking/sizes.ll @@ -31,7 +31,6 @@ entry: } declare i32 @bar(i8*) -declare i32 @bar2(i64*) define i32 @foo1(i32 %n) nounwind { entry: @@ -66,11 +65,6 @@ entry: %call = tail call i8* @malloc(i64 %n) ; <i8*> [#uses=1] ; CHECK: %call = ; CHECK: ==> %n elements, %n bytes allocated - %mallocsize = mul i64 %n, 8 ; <i64> [#uses=1] - %malloccall = tail call i8* @malloc(i64 %mallocsize) ; <i8*> [#uses=1] - %call3 = bitcast i8* %malloccall to i64* ; <i64*> [#uses=1] -; CHECK: %malloccall = -; CHECK: ==> (8 * %n) elements, (8 * %n) bytes allocated %call2 = tail call i8* @calloc(i64 2, i64 4) nounwind ; <i8*> [#uses=1] ; CHECK: %call2 = ; CHECK: ==> 8 elements, 8 bytes allocated @@ -78,12 +72,10 @@ entry: ; CHECK: %call4 = ; CHECK: ==> 16 elements, 16 bytes allocated %call6 = tail call i32 @bar(i8* %call) nounwind ; <i32> [#uses=1] - %call7 = tail call i32 @bar2(i64* %call3) nounwind ; <i32> [#uses=1] %call8 = tail call i32 @bar(i8* %call2) nounwind ; <i32> [#uses=1] %call10 = tail call i32 @bar(i8* %call4) nounwind ; <i32> [#uses=1] %add = add i32 %call8, %call6 ; <i32> [#uses=1] - %add10 = add i32 %add, %call7 ; <i32> [#uses=1] - %add11 = add i32 %add10, %call10 ; <i32> [#uses=1] + %add11 = add i32 %add, %call10 ; <i32> [#uses=1] ret i32 %add11 } |