|
| 1 | +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py |
| 2 | +; RUN: llc < %s -mtriple=i686-pc-linux-gnu | FileCheck %s -check-prefix=DEFAULT |
| 3 | +; RUN: llc < %s -mtriple=i686-pc-linux-gnu -x86-experimental-pref-innermost-loop-alignment=5 | FileCheck %s -check-prefix=ALIGN32 |
| 4 | +; RUN: llc < %s -mtriple=i686-pc-linux-gnu -x86-experimental-pref-loop-alignment=5 -x86-experimental-pref-innermost-loop-alignment=6 | FileCheck %s -check-prefix=ALIGN64 |
| 5 | + |
| 6 | +declare void @foo() |
| 7 | + |
| 8 | +define void @test(i32 %n, i32 %m) { |
| 9 | +; DEFAULT-LABEL: test: |
| 10 | +; DEFAULT: .p2align 4, 0x90 |
| 11 | +; DEFAULT-NEXT: .LBB0_1: # %outer |
| 12 | +; DEFAULT-NEXT: # =>This Loop Header: Depth=1 |
| 13 | +; DEFAULT-NEXT: # Child Loop BB0_2 Depth 2 |
| 14 | +; DEFAULT: .p2align 4, 0x90 |
| 15 | +; DEFAULT-NEXT: .LBB0_2: # %inner |
| 16 | +; DEFAULT-NEXT: # Parent Loop BB0_1 Depth=1 |
| 17 | + |
| 18 | +; ALIGN32-LABEL: test: |
| 19 | +; ALIGN32: .p2align 4, 0x90 |
| 20 | +; ALIGN32-NEXT: .LBB0_1: # %outer |
| 21 | +; ALIGN32-NEXT: # =>This Loop Header: Depth=1 |
| 22 | +; ALIGN32-NEXT: # Child Loop BB0_2 Depth 2 |
| 23 | +; ALIGN32: .p2align 5, 0x90 |
| 24 | +; ALIGN32-NEXT: .LBB0_2: # %inner |
| 25 | +; ALIGN32-NEXT: # Parent Loop BB0_1 Depth=1 |
| 26 | +; ALIGN32-NEXT: # => This Inner Loop Header: Depth=2 |
| 27 | + |
| 28 | +; ALIGN64-LABEL: test: |
| 29 | +; ALIGN64: .p2align 5, 0x90 |
| 30 | +; ALIGN64-NEXT: .LBB0_1: # %outer |
| 31 | +; ALIGN64-NEXT: # =>This Loop Header: Depth=1 |
| 32 | +; ALIGN64-NEXT: # Child Loop BB0_2 Depth 2 |
| 33 | +; ALIGN64: .p2align 6, 0x90 |
| 34 | +; ALIGN64-NEXT: .LBB0_2: # %inner |
| 35 | +; ALIGN64-NEXT: # Parent Loop BB0_1 Depth=1 |
| 36 | +; ALIGN64-NEXT: # => This Inner Loop Header: Depth=2 |
| 37 | + |
| 38 | +entry: |
| 39 | + br label %outer |
| 40 | + |
| 41 | +outer: |
| 42 | + %outer.iv = phi i32 [0, %entry], [%outer.iv.next, %outer_bb] |
| 43 | + br label %inner |
| 44 | + |
| 45 | +inner: |
| 46 | + %inner.iv = phi i32 [0, %outer], [%inner.iv.next, %inner] |
| 47 | + call void @foo() |
| 48 | + %inner.iv.next = add i32 %inner.iv, 1 |
| 49 | + %inner.cond = icmp ne i32 %inner.iv.next, %m |
| 50 | + br i1 %inner.cond, label %inner, label %outer_bb |
| 51 | + |
| 52 | +outer_bb: |
| 53 | + %outer.iv.next = add i32 %outer.iv, 1 |
| 54 | + %outer.cond = icmp ne i32 %outer.iv.next, %n |
| 55 | + br i1 %outer.cond, label %outer, label %exit |
| 56 | + |
| 57 | +exit: |
| 58 | + ret void |
| 59 | +} |
0 commit comments