[llvm-bugs] [Bug 43410] New: [ARM] use splat load to break false dependence
via llvm-bugs
llvm-bugs at lists.llvm.org
Mon Sep 23 08:49:35 PDT 2019
https://bugs.llvm.org/show_bug.cgi?id=43410
Bug ID: 43410
Summary: [ARM] use splat load to break false dependence
Product: libraries
Version: trunk
Hardware: PC
OS: All
Status: NEW
Severity: enhancement
Priority: P
Component: Backend: ARM
Assignee: unassignedbugs at nondot.org
Reporter: spatel+llvm at rotateright.com
CC: llvm-bugs at lists.llvm.org, peter.smith at linaro.org,
Ties.Stuij at arm.com
Copied from regression test in llvm/test/CodeGen/ARM/a15-partial-update.ll and
as discussed in https://reviews.llvm.org/D67363:
define void @t2(<4 x i8> *%in, <4 x i8> *%out, i32 %n) {
; CHECK-LABEL: t2:
; CHECK: @ %bb.0: @ %entry
; CHECK-NEXT: add r0, r0, #4
; CHECK-NEXT: add r1, r1, #4
; CHECK-NEXT: .LBB1_1: @ %loop
; CHECK-NEXT: @ =>This Inner Loop Header: Depth=1
; CHECK-NEXT: vmov.f64 d16, #5.000000e-01
; CHECK-NEXT: vld1.32 {d16[0]}, [r0:32]
; CHECK-NEXT: vmovl.u8 q8, d16
; CHECK-NEXT: vuzp.8 d16, d18
; CHECK-NEXT: vst1.32 {d16[0]}, [r1:32]!
; CHECK-NEXT: add r0, r0, #4
; CHECK-NEXT: subs r2, r2, #1
; CHECK-NEXT: beq .LBB1_1
; CHECK-NEXT: @ %bb.2: @ %ret
; CHECK-NEXT: bx lr
entry:
br label %loop
loop:
%oldcount = phi i32 [0, %entry], [%newcount, %loop]
%newcount = add i32 %oldcount, 1
%p1 = getelementptr <4 x i8>, <4 x i8> *%in, i32 %newcount
%p2 = getelementptr <4 x i8>, <4 x i8> *%out, i32 %newcount
%tmp1 = load <4 x i8> , <4 x i8> *%p1, align 4
store <4 x i8> %tmp1, <4 x i8> *%p2
%cmp = icmp eq i32 %newcount, %n
br i1 %cmp, label %loop, label %ret
ret:
ret void
}
--------------------------------------------------------------------------
We insert "vmov.f64 d16, #5.000000e-01" (the 0.5 is a semi-arbitrarily chosen
constant value) to break a false dependence on d16. But we could break that
false dependence without any extra instructions. Use a splat load to overwrite
the entire d16.
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190923/488d88cb/attachment.html>
More information about the llvm-bugs
mailing list