1 ; RUN: llc -mtriple=thumbv7m-none-eabi %s -mcpu=cortex-m3 -o - | FileCheck %s
2 ; RUN: llc -mtriple=thumbv7m-none-eabi %s -mcpu=cortex-m4 -o - | FileCheck %s
3 ; RUN: llc -mtriple=thumbv8m-none-eabi %s -mcpu=cortex-m33 -o - | FileCheck %s
5 define void @test_loop_alignment(ptr %in, ptr %out) optsize {
6 ; CHECK-LABEL: test_loop_alignment:
14 %i = phi i32 [ 0, %entry ], [ %i.next, %loop ]
15 %in.addr = getelementptr inbounds i32, ptr %in, i32 %i
16 %lhs = load i32, ptr %in.addr, align 4
17 %res = mul nsw i32 %lhs, 5
18 %out.addr = getelementptr inbounds i32, ptr %out, i32 %i
19 store i32 %res, ptr %out.addr, align 4
20 %i.next = add i32 %i, 1
21 %done = icmp eq i32 %i.next, 1024
22 br i1 %done, label %end, label %loop
28 define void @test_loop_alignment_minsize(ptr %in, ptr %out) minsize {
29 ; CHECK-LABEL: test_loop_alignment_minsize:
30 ; CHECK: movs {{r[0-9]+}}, #0
37 %i = phi i32 [ 0, %entry ], [ %i.next, %loop ]
38 %in.addr = getelementptr inbounds i32, ptr %in, i32 %i
39 %lhs = load i32, ptr %in.addr, align 4
40 %res = mul nsw i32 %lhs, 5
41 %out.addr = getelementptr inbounds i32, ptr %out, i32 %i
42 store i32 %res, ptr %out.addr, align 4
43 %i.next = add i32 %i, 1
44 %done = icmp eq i32 %i.next, 1024
45 br i1 %done, label %end, label %loop