https://bugs.llvm.org/show_bug.cgi?id=51091
Bug ID: 51091
Summary: Failure to widen loads from wider dereferenceable
pointers
Product: libraries
Version: trunk
Hardware: PC
OS: Windows NT
Status: NEW
Severity: enhancement
Priority: P
Component: Backend: X86
Assignee: unassignedb...@nondot.org
Reporter: llvm-...@redking.me.uk
CC: a.bat...@hotmail.com, craig.top...@gmail.com,
lebedev...@gmail.com, llvm-bugs@lists.llvm.org,
llvm-...@redking.me.uk, pengfei.w...@intel.com,
spatel+l...@rotateright.com
If we have generated this:
define float @Dot01(float* dereferenceable(16) %a0, float* dereferenceable(16)
%a1) {
%bcx01 = bitcast float* %a0 to <2 x float>*
%bcy01 = bitcast float* %a1 to <2 x float>*
%x01 = load <2 x float>, <2 x float>* %bcx01, align 4
%y01 = load <2 x float>, <2 x float>* %bcy01, align 4
%mul01 = fmul <2 x float> %x01, %y01
%mul0 = extractelement <2 x float> %mul01, i32 0
%mul1 = extractelement <2 x float> %mul01, i32 1
%dot01 = fadd float %mul0, %mul1
ret float %dot01
}
llc -mcpu=znver2
Dot01:
vmovsd (%rdi), %xmm0 # xmm0 = mem[0],zero
vmovsd (%rsi), %xmm1 # xmm1 = mem[0],zero
vmulps %xmm1, %xmm0, %xmm0
vmovshdup %xmm0, %xmm1 # xmm1 = xmm0[1,1,3,3]
vaddss %xmm1, %xmm0, %xmm0
retq
As we know that the pointers at (%rdi) and (%rsi) are both dereferenceable
across the full 16 bytes - why can't we load full float4 loads, which would let
us fold at least one of the loads:
Dot01:
vmovups (%rdi), %xmm0
vmulps (%rsi), %xmm0, %xmm0
vmovshdup %xmm0, %xmm1 # xmm1 = xmm0[1,1,3,3]
vaddss %xmm1, %xmm0, %xmm0
retq
(I'm not sure if we can perform this generally in DAG or VectorCombine or
whether we should just handle it inside x86's EltsFromConsecutiveLoads or
something).
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs