Add support for eliminating stores that store the same value that was just loaded.
[oota-llvm.git] / test / Transforms / DeadStoreElimination / PartialStore.ll
1 ; RUN: llvm-as < %s | opt -dse | llvm-dis | \
2 ; RUN:    not grep {store i8}
3 ; Ensure that the dead store is deleted in this case.  It is wholely
4 ; overwritten by the second store.
5 define i32 @test() {
6         %V = alloca i32         ; <i32*> [#uses=3]
7         %V2 = bitcast i32* %V to i8*            ; <i8*> [#uses=1]
8         store i8 0, i8* %V2
9         store i32 1234567, i32* %V
10         %X = load i32* %V               ; <i32> [#uses=1]
11         ret i32 %X
12 }
13