1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --force-update
2 ; RUN: llc -asm-verbose=true < %s | FileCheck %s
4 ; MachineLICM should check dominance before hoisting instructions.
5 ; only the load of a0 is guaranteed to execute, so only it can be hoisted.
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-apple-macosx10.7.2"
10 define void @CMSColorWorldCreateParametricData(
11 ; CHECK-LABEL: CMSColorWorldCreateParametricData:
12 ; CHECK: ## %bb.0: ## %entry
13 ; CHECK-NEXT: xorl %eax, %eax
14 ; CHECK-NEXT: movb (%rdi), %dil
15 ; CHECK-NEXT: LBB0_1: ## %for.body.i
16 ; CHECK-NEXT: ## =>This Inner Loop Header: Depth=1
17 ; CHECK-NEXT: testb %dil, %dil
18 ; CHECK-NEXT: je LBB0_5
19 ; CHECK-NEXT: ## %bb.2: ## %if.then26.i
20 ; CHECK-NEXT: ## in Loop: Header=BB0_1 Depth=1
21 ; CHECK-NEXT: cmpb $1, (%rsi)
22 ; CHECK-NEXT: jne LBB0_4
23 ; CHECK-NEXT: ## %bb.3: ## %if.else.i.i
24 ; CHECK-NEXT: ## in Loop: Header=BB0_1 Depth=1
25 ; CHECK-NEXT: cmpb $2, (%rdx)
26 ; CHECK-NEXT: jne LBB0_5
27 ; CHECK-NEXT: LBB0_4: ## %lor.lhs.false.i.i
28 ; CHECK-NEXT: ## in Loop: Header=BB0_1 Depth=1
29 ; CHECK-NEXT: cmpb $3, (%rcx)
30 ; CHECK-NEXT: jne LBB0_6
31 ; CHECK-NEXT: LBB0_5: ## %for.inc.i
32 ; CHECK-NEXT: ## in Loop: Header=BB0_1 Depth=1
33 ; CHECK-NEXT: incq %rax
34 ; CHECK-NEXT: cmpq %r8, %rax
35 ; CHECK-NEXT: jb LBB0_1
36 ; CHECK-NEXT: LBB0_6: ## %if.end28.i
38 ptr dereferenceable(1) %a0,
39 ptr dereferenceable(1) %a1,
40 ptr dereferenceable(1) %a2,
41 ptr dereferenceable(1) %a3,
42 i64 %count) nounwind uwtable optsize ssp readonly nofree nosync {
47 %i = phi i64 [0, %entry], [%i.inc, %for.inc.i]
48 %0 = load i8, ptr %a0, !invariant.load !0
49 %cond0 = icmp eq i8 %0, 0
50 br i1 %cond0, label %for.inc.i, label %if.then26.i
53 %1 = load i8, ptr %a1, !invariant.load !0
54 %cond1 = icmp eq i8 %1, 1
55 br i1 %cond1, label %if.else.i.i, label %lor.lhs.false.i.i
58 %2 = load i8, ptr %a2, !invariant.load !0
59 %cond2 = icmp eq i8 %2, 2
60 br i1 %cond2, label %lor.lhs.false.i.i, label %for.inc.i
63 %3 = load i8, ptr %a3, !invariant.load !0
64 %cond3 = icmp eq i8 %3, 3
65 br i1 %cond3, label %for.inc.i, label %if.end28.i
68 %i.inc = add nsw i64 %i, 1
69 %cmp17.i = icmp ult i64 %i.inc, %count
70 br i1 %cmp17.i, label %for.body.i, label %if.end28.i