[InstCombine] Fold IntToPtr and PtrToInt into preceding loads.
[oota-llvm.git] / test / Transforms / InstCombine / 2009-01-31-Pressure.ll
1 ; RUN: opt < %s -instcombine -S | grep "%B = add i8 %b, %x"
2 ; PR2698
3
4 declare void @use1(i1)
5 declare void @use8(i8)
6
7 define void @test1(i8 %a, i8 %b, i8 %x) {
8   %A = add i8 %a, %x
9   %B = add i8 %b, %x
10   %C = icmp eq i8 %A, %B
11   call void @use1(i1 %C)
12   ret void
13 }
14
15 define void @test2(i8 %a, i8 %b, i8 %x) {
16   %A = add i8 %a, %x
17   %B = add i8 %b, %x
18   %C = icmp eq i8 %A, %B
19   call void @use1(i1 %C)
20   call void @use8(i8 %A)
21   ret void
22 }