brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · ed56a33 Raw
38 lines · plain
1; RUN: opt -hexagon-loop-idiom -S -mtriple hexagon-unknown-elf < %s \2; RUN:  | FileCheck %s3; RUN: opt -p hexagon-loop-idiom -S -mtriple hexagon-unknown-elf < %s \4; RUN:  | FileCheck %s5 6define void @PR14241(ptr %s, i64 %size) #0 {7; Ensure that we don't form a memcpy for strided loops. Briefly, when we taught8; LoopIdiom about memmove and strided loops, this got miscompiled into a memcpy9; instead of a memmove. If we get the memmove transform back, this will catch10; regressions.11;12; CHECK-LABEL: @PR14241(13 14entry:15  %end.idx = add i64 %size, -116  %end.ptr = getelementptr inbounds i32, ptr %s, i64 %end.idx17  br label %while.body18; CHECK-NOT: memcpy19; CHECK: memmove20 21while.body:22  %phi.ptr = phi ptr [ %s, %entry ], [ %next.ptr, %while.body ]23  %src.ptr = getelementptr inbounds i32, ptr %phi.ptr, i64 124  %val = load i32, ptr %src.ptr, align 425; CHECK: load26  store i32 %val, ptr %phi.ptr, align 427; CHECK: store28  %next.ptr = getelementptr inbounds i32, ptr %phi.ptr, i64 129  %cmp = icmp eq ptr %next.ptr, %end.ptr30  br i1 %cmp, label %exit, label %while.body31 32exit:33  ret void34; CHECK: ret void35}36 37attributes #0 = { nounwind }38