blob: fa3dc0ae141eb5097f077b28fffe42c53adda1c6 [file] [log] [blame]
Chris Lattnerf3ecd2d2008-06-20 05:12:56 +00001; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep load | count 3
2; PR2471
3
4declare i32 @x(i32*)
5define i32 @b(i32* %a, i32* %b) {
6entry:
7 %tmp1 = load i32* %a
8 %tmp3 = load i32* %b
9 %add = add i32 %tmp1, %tmp3
10 %call = call i32 @x( i32* %a )
11 %tobool = icmp ne i32 %add, 0
12 ; not safe to turn into an uncond load
13 %cond = select i1 %tobool, i32* %b, i32* %a
14 %tmp8 = load i32* %cond
15 ret i32 %tmp8
16}