Enhance earlycse to do CSE of casts, instsimplify and die.
[oota-llvm.git] / test / Transforms / EarlyCSE / basic.ll
1 ; RUN: opt < %s -S -early-cse | FileCheck %s
2
3
4 ; CHECK: @test1
5 define void @test1(i8 %V, i32 *%P) {
6   %A = bitcast i64 42 to double  ;; dead
7   %B = add i32 4, 19             ;; constant folds
8   store i32 %B, i32* %P
9   
10   ; CHECK-NEXT: store i32 23, i32* %P
11   
12   %C = zext i8 %V to i32
13   %D = zext i8 %V to i32  ;; CSE
14   volatile store i32 %C, i32* %P
15   volatile store i32 %D, i32* %P
16   
17   ; CHECK-NEXT: %C = zext i8 %V to i32
18   ; CHECK-NEXT: volatile store i32 %C
19   ; CHECK-NEXT: volatile store i32 %C
20   ret void
21 }