From 3124e22ade9d96af8e2cb3b1708ae9da9bee9636 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 26 Nov 2009 16:08:41 +0000 Subject: rename test git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89950 91177308-0d34-0410-b5e6-96231b3b80d8 --- .../BasicAA/2008-12-09-GEP-IndicesAlias.ll | 73 ---------------------- test/Analysis/BasicAA/gep-alias.ll | 73 ++++++++++++++++++++++ 2 files changed, 73 insertions(+), 73 deletions(-) delete mode 100644 test/Analysis/BasicAA/2008-12-09-GEP-IndicesAlias.ll create mode 100644 test/Analysis/BasicAA/gep-alias.ll (limited to 'test') diff --git a/test/Analysis/BasicAA/2008-12-09-GEP-IndicesAlias.ll b/test/Analysis/BasicAA/2008-12-09-GEP-IndicesAlias.ll deleted file mode 100644 index e8f8a8e..0000000 --- a/test/Analysis/BasicAA/2008-12-09-GEP-IndicesAlias.ll +++ /dev/null @@ -1,73 +0,0 @@ -; RUN: opt < %s -gvn -instcombine -S |& FileCheck %s -; Make sure that basicaa thinks R and r are must aliases. - -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" - -define i32 @test1(i8 * %P) { -entry: - %Q = bitcast i8* %P to {i32, i32}* - %R = getelementptr {i32, i32}* %Q, i32 0, i32 1 - %S = load i32* %R - - %q = bitcast i8* %P to {i32, i32}* - %r = getelementptr {i32, i32}* %q, i32 0, i32 1 - %s = load i32* %r - - %t = sub i32 %S, %s - ret i32 %t -; CHECK: @test1 -; CHECK: ret i32 0 -} - -define i32 @test2(i8 * %P) { -entry: - %Q = bitcast i8* %P to {i32, i32, i32}* - %R = getelementptr {i32, i32, i32}* %Q, i32 0, i32 1 - %S = load i32* %R - - %r = getelementptr {i32, i32, i32}* %Q, i32 0, i32 2 - store i32 42, i32* %r - - %s = load i32* %R - - %t = sub i32 %S, %s - ret i32 %t -; CHECK: @test2 -; CHECK: ret i32 0 -} - - -; This was a miscompilation. -define i32 @test3({float, {i32, i32, i32}}* %P) { -entry: - %P2 = getelementptr {float, {i32, i32, i32}}* %P, i32 0, i32 1 - %R = getelementptr {i32, i32, i32}* %P2, i32 0, i32 1 - %S = load i32* %R - - %r = getelementptr {i32, i32, i32}* %P2, i32 0, i32 2 - store i32 42, i32* %r - - %s = load i32* %R - - %t = sub i32 %S, %s - ret i32 %t -; CHECK: @test3 -; CHECK: ret i32 0 -} - - -;; This is reduced from the SmallPtrSet constructor. -%SmallPtrSetImpl = type { i8**, i32, i32, i32, [1 x i8*] } -%SmallPtrSet64 = type { %SmallPtrSetImpl, [64 x i8*] } - -define i32 @test4(%SmallPtrSet64* %P) { -entry: - %tmp2 = getelementptr inbounds %SmallPtrSet64* %P, i64 0, i32 0, i32 1 - store i32 64, i32* %tmp2, align 8 - %tmp3 = getelementptr inbounds %SmallPtrSet64* %P, i64 0, i32 0, i32 4, i64 64 - store i8* null, i8** %tmp3, align 8 - %tmp4 = load i32* %tmp2, align 8 - ret i32 %tmp4 -; CHECK: @test4 -; CHECK: ret i32 64 -} diff --git a/test/Analysis/BasicAA/gep-alias.ll b/test/Analysis/BasicAA/gep-alias.ll new file mode 100644 index 0000000..e8f8a8e --- /dev/null +++ b/test/Analysis/BasicAA/gep-alias.ll @@ -0,0 +1,73 @@ +; RUN: opt < %s -gvn -instcombine -S |& FileCheck %s +; Make sure that basicaa thinks R and r are must aliases. + +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" + +define i32 @test1(i8 * %P) { +entry: + %Q = bitcast i8* %P to {i32, i32}* + %R = getelementptr {i32, i32}* %Q, i32 0, i32 1 + %S = load i32* %R + + %q = bitcast i8* %P to {i32, i32}* + %r = getelementptr {i32, i32}* %q, i32 0, i32 1 + %s = load i32* %r + + %t = sub i32 %S, %s + ret i32 %t +; CHECK: @test1 +; CHECK: ret i32 0 +} + +define i32 @test2(i8 * %P) { +entry: + %Q = bitcast i8* %P to {i32, i32, i32}* + %R = getelementptr {i32, i32, i32}* %Q, i32 0, i32 1 + %S = load i32* %R + + %r = getelementptr {i32, i32, i32}* %Q, i32 0, i32 2 + store i32 42, i32* %r + + %s = load i32* %R + + %t = sub i32 %S, %s + ret i32 %t +; CHECK: @test2 +; CHECK: ret i32 0 +} + + +; This was a miscompilation. +define i32 @test3({float, {i32, i32, i32}}* %P) { +entry: + %P2 = getelementptr {float, {i32, i32, i32}}* %P, i32 0, i32 1 + %R = getelementptr {i32, i32, i32}* %P2, i32 0, i32 1 + %S = load i32* %R + + %r = getelementptr {i32, i32, i32}* %P2, i32 0, i32 2 + store i32 42, i32* %r + + %s = load i32* %R + + %t = sub i32 %S, %s + ret i32 %t +; CHECK: @test3 +; CHECK: ret i32 0 +} + + +;; This is reduced from the SmallPtrSet constructor. +%SmallPtrSetImpl = type { i8**, i32, i32, i32, [1 x i8*] } +%SmallPtrSet64 = type { %SmallPtrSetImpl, [64 x i8*] } + +define i32 @test4(%SmallPtrSet64* %P) { +entry: + %tmp2 = getelementptr inbounds %SmallPtrSet64* %P, i64 0, i32 0, i32 1 + store i32 64, i32* %tmp2, align 8 + %tmp3 = getelementptr inbounds %SmallPtrSet64* %P, i64 0, i32 0, i32 4, i64 64 + store i8* null, i8** %tmp3, align 8 + %tmp4 = load i32* %tmp2, align 8 + ret i32 %tmp4 +; CHECK: @test4 +; CHECK: ret i32 64 +} -- cgit v1.1