1 ; RUN: opt -hexagon-loop-idiom -S -mtriple hexagon-unknown-elf < %s \
3 ; RUN: opt -p hexagon-loop-idiom -S -mtriple hexagon-unknown-elf < %s \
6 define void @PR14241(ptr %s, i64 %size) #0 {
7 ; Ensure that we don't form a memcpy for strided loops. Briefly, when we taught
8 ; LoopIdiom about memmove and strided loops, this got miscompiled into a memcpy
9 ; instead of a memmove. If we get the memmove transform back, this will catch
12 ; CHECK-LABEL: @PR14241(
15 %end.idx = add i64 %size, -1
16 %end.ptr = getelementptr inbounds i32, ptr %s, i64 %end.idx
22 %phi.ptr = phi ptr [ %s, %entry ], [ %next.ptr, %while.body ]
23 %src.ptr = getelementptr inbounds i32, ptr %phi.ptr, i64 1
24 %val = load i32, ptr %src.ptr, align 4
26 store i32 %val, ptr %phi.ptr, align 4
28 %next.ptr = getelementptr inbounds i32, ptr %phi.ptr, i64 1
29 %cmp = icmp eq ptr %next.ptr, %end.ptr
30 br i1 %cmp, label %exit, label %while.body
37 attributes #0 = { nounwind }