1 ; do not replace a 'select' with 'or' in 'select - cmp - br' sequence
2 ; RUN: opt -instcombine -S < %s | FileCheck %s
3 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
4 target triple = "x86_64-unknown-linux-gnu"
8 define void @test(i32 %len) {
10 %cmp = icmp ult i32 %len, 8
11 %cond = select i1 %cmp, i32 %len, i32 8
12 %cmp11 = icmp ult i32 0, %cond
13 br i1 %cmp11, label %for.body, label %for.end
15 for.body: ; preds = %entry, %for.body
16 %i.02 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
17 tail call void @f(i32 %cond)
18 %inc = add i32 %i.02, 1
19 %cmp1 = icmp ult i32 %inc, %cond
20 br i1 %cmp1, label %for.body, label %for.end
22 for.end: ; preds = %for.body, %entry