Fix DAGCombiner to avoid going into an infinite loop when it
[oota-llvm.git] / test / CodeGen / X86 / narrow-shl-load.ll
1 ; RUN: llc -march=x86-64 < %s
2
3 ; DAGCombiner should fold this code in finite time.
4
5 ; rdar://8606584
6
7 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
8 target triple = "x86_64-pc-linux-gnu"
9
10 define void @D() nounwind readnone {
11 bb.nph:
12   br label %while.cond
13
14 while.cond:                                       ; preds = %while.cond, %bb.nph
15   %tmp6 = load i32* undef, align 4
16   %and = or i64 undef, undef
17   %conv11 = zext i32 undef to i64
18   %conv14 = zext i32 %tmp6 to i64
19   %shl15 = shl i64 %conv14, 1
20   %shl15.masked = and i64 %shl15, 4294967294
21   %and17 = or i64 %shl15.masked, %conv11
22   %add = add i64 %and17, 1
23   %xor = xor i64 %add, %and
24   %tmp20 = load i64* undef, align 8
25   %add21 = add i64 %xor, %tmp20
26   %conv22 = trunc i64 %add21 to i32
27   store i32 %conv22, i32* undef, align 4
28   br i1 false, label %while.end, label %while.cond
29
30 while.end:                                        ; preds = %while.cond
31   ret void
32 }