Re-implement the main strength-reduction portion of LoopStrengthReduction.
[oota-llvm.git] / test / CodeGen / X86 / omit-label.ll
1 ; RUN: llc < %s -asm-verbose=false -mtriple=x86_64-linux-gnu | FileCheck %s
2 ; PR4126
3 ; PR4732
4
5 ; Don't omit these labels' definitions.
6
7 ; CHECK: bux:
8 ; CHECK: LBB1_1:
9
10 define void @bux(i32 %p_53) nounwind optsize {
11 entry:
12         %0 = icmp eq i32 %p_53, 0               ; <i1> [#uses=1]
13         %1 = icmp sgt i32 %p_53, 0              ; <i1> [#uses=1]
14         %or.cond = and i1 %0, %1                ; <i1> [#uses=1]
15         br i1 %or.cond, label %bb.i, label %bb3
16
17 bb.i:           ; preds = %entry
18         %2 = add i32 %p_53, 1           ; <i32> [#uses=1]
19         %3 = icmp slt i32 %2, 0         ; <i1> [#uses=0]
20         br label %bb3
21
22 bb3:            ; preds = %bb.i, %entry
23         %4 = tail call i32 (...)* @baz(i32 0) nounwind          ; <i32> [#uses=0]
24         ret void
25 }
26
27 declare i32 @baz(...)
28
29 ; Don't omit this label in the assembly output.
30 ; CHECK: int321:
31 ; CHECK: LBB2_1
32 ; CHECK: LBB2_1
33 ; CHECK: LBB2_1:
34
35 define void @int321(i8 signext %p_103, i32 %uint8p_104) nounwind readnone {
36 entry:
37   %tobool = icmp eq i8 %p_103, 0                  ; <i1> [#uses=1]
38   %cmp.i = icmp sgt i8 %p_103, 0                  ; <i1> [#uses=1]
39   %or.cond = and i1 %tobool, %cmp.i               ; <i1> [#uses=1]
40   br i1 %or.cond, label %land.end.i, label %for.cond.preheader
41
42 land.end.i:                                       ; preds = %entry
43   %conv3.i = sext i8 %p_103 to i32                ; <i32> [#uses=1]
44   %div.i = sdiv i32 1, %conv3.i                   ; <i32> [#uses=1]
45   %tobool.i = icmp eq i32 %div.i, -2147483647     ; <i1> [#uses=0]
46   br label %for.cond.preheader
47
48 for.cond.preheader:                               ; preds = %land.end.i, %entry
49   %cmp = icmp sgt i8 %p_103, 1                    ; <i1> [#uses=1]
50   br i1 %cmp, label %for.end.split, label %for.cond
51
52 for.cond:                                         ; preds = %for.cond.preheader, %for.cond
53   br label %for.cond
54
55 for.end.split:                                    ; preds = %for.cond.preheader
56   ret void
57 }