diff options
author | Tanya Lattner <tonic@nondot.org> | 2008-03-25 04:26:08 +0000 |
---|---|---|
committer | Tanya Lattner <tonic@nondot.org> | 2008-03-25 04:26:08 +0000 |
commit | 6f729d601c8a6a9710356aadb42dc8d0efa95bf2 (patch) | |
tree | e662b3ee5539d7594ab49eda3eae140424ce499d /test/Transforms/InstCombine/load.ll | |
parent | a2fb634defce316ec972aa6f3ca3a941b4656f5e (diff) |
Byebye llvm-upgrade!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48762 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/InstCombine/load.ll')
-rw-r--r-- | test/Transforms/InstCombine/load.ll | 95 |
1 files changed, 46 insertions, 49 deletions
diff --git a/test/Transforms/InstCombine/load.ll b/test/Transforms/InstCombine/load.ll index 5c7d580a46..907550a778 100644 --- a/test/Transforms/InstCombine/load.ll +++ b/test/Transforms/InstCombine/load.ll @@ -1,73 +1,70 @@ ; This test makes sure that these instructions are properly eliminated. ; -; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | not grep load +; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep load -%X = constant int 42 -%X2 = constant int 47 -%Y = constant [2 x { int, float }] [ { int, float } { int 12, float 1.0 }, - { int, float } { int 37, float 0x3FF3B2FEC0000000 } ] -%Z = constant [2 x { int, float }] zeroinitializer +@X = constant i32 42 ; <i32*> [#uses=2] +@X2 = constant i32 47 ; <i32*> [#uses=1] +@Y = constant [2 x { i32, float }] [ { i32, float } { i32 12, float 1.000000e+00 }, { i32, float } { i32 37, float 0x3FF3B2FEC0000000 } ] ; <[2 x { i32, float }]*> [#uses=2] +@Z = constant [2 x { i32, float }] zeroinitializer ; <[2 x { i32, float }]*> [#uses=1] -int %test1() { - %B = load int* %X - ret int %B +define i32 @test1() { + %B = load i32* @X ; <i32> [#uses=1] + ret i32 %B } -float %test2() { - %A = getelementptr [2 x { int, float}]* %Y, long 0, long 1, uint 1 - %B = load float* %A +define float @test2() { + %A = getelementptr [2 x { i32, float }]* @Y, i64 0, i64 1, i32 1 ; <float*> [#uses=1] + %B = load float* %A ; <float> [#uses=1] ret float %B } - -int %test3() { - %A = getelementptr [2 x { int, float}]* %Y, long 0, long 0, uint 0 - %B = load int* %A - ret int %B +define i32 @test3() { + %A = getelementptr [2 x { i32, float }]* @Y, i64 0, i64 0, i32 0 ; <i32*> [#uses=1] + %B = load i32* %A ; <i32> [#uses=1] + ret i32 %B } -int %test4() { - %A = getelementptr [2 x { int, float}]* %Z, long 0, long 1, uint 0 - %B = load int* %A - ret int %B +define i32 @test4() { + %A = getelementptr [2 x { i32, float }]* @Z, i64 0, i64 1, i32 0 ; <i32*> [#uses=1] + %B = load i32* %A ; <i32> [#uses=1] + ret i32 %B } -; load (select (Cond, &V1, &V2)) --> select(Cond, load &V1, load &V2) -int %test5(bool %C) { - %Y = select bool %C, int* %X, int* %X2 - %Z = load int* %Y - ret int %Z +define i32 @test5(i1 %C) { + %Y = select i1 %C, i32* @X, i32* @X2 ; <i32*> [#uses=1] + %Z = load i32* %Y ; <i32> [#uses=1] + ret i32 %Z } -int %test7(int %X) { - %V = getelementptr int* null, int %X - %R = load int* %V - ret int %R +define i32 @test7(i32 %X) { + %V = getelementptr i32* null, i32 %X ; <i32*> [#uses=1] + %R = load i32* %V ; <i32> [#uses=1] + ret i32 %R } -int %test8(int* %P) { - store int 1, int* %P - %X = load int* %P ;; Trivial store->load forwarding - ret int %X +define i32 @test8(i32* %P) { + store i32 1, i32* %P + %X = load i32* %P ; <i32> [#uses=1] + ret i32 %X } -int %test9(int* %P) { - %X = load int* %P ;; Trivial load cse - %Y = load int* %P - %Z = sub int %X, %Y - ret int %Z +define i32 @test9(i32* %P) { + %X = load i32* %P ; <i32> [#uses=1] + %Y = load i32* %P ; <i32> [#uses=1] + %Z = sub i32 %X, %Y ; <i32> [#uses=1] + ret i32 %Z } -int %test10(bool %C, int* %P, int* %Q) { - br bool %C, label %T, label %F -T: - store int 1, int* %Q - store int 0, int* %P +define i32 @test10(i1 %C.upgrd.1, i32* %P, i32* %Q) { + br i1 %C.upgrd.1, label %T, label %F +T: ; preds = %0 + store i32 1, i32* %Q + store i32 0, i32* %P br label %C -F: - store int 0, int* %P +F: ; preds = %0 + store i32 0, i32* %P br label %C -C: - %V = load int* %P ;; always 0 - ret int %V +C: ; preds = %F, %T + %V = load i32* %P ; <i32> [#uses=1] + ret i32 %V } |