[llvm-bugs] [Bug 30596] New: [X86][AVX] Broadcast loads don't respect dependencies

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Oct 3 03:40:21 PDT 2016


https://llvm.org/bugs/show_bug.cgi?id=30596

            Bug ID: 30596
           Summary: [X86][AVX] Broadcast loads don't respect dependencies
           Product: libraries
           Version: 3.9
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: X86
          Assignee: unassignedbugs at nondot.org
          Reporter: llvm-dev at redking.me.uk
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

As detailed in https://reviews.llvm.org/D25039:

declare void @gfunc(<4 x float>*)
declare void @llvm.lifetime.start(i64, i8*)
declare void @llvm.lifetime.end(i64, i8*)

define float @broadcast_lifetime() nounwind {
  %1 = alloca <4 x float>, align 16
  %2 = alloca <4 x float>, align 16
  %3 = bitcast <4 x float>* %1 to i8*
  %4 = bitcast <4 x float>* %2 to i8*

  call void @llvm.lifetime.start(i64 16, i8* %3)
  call void @gfunc(<4 x float>* %1)
  %5 = load <4 x float>, <4 x float>* %1, align 16
  call void @llvm.lifetime.end(i64 16, i8* %3)

  call void @llvm.lifetime.start(i64 16, i8* %4)
  call void @gfunc(<4 x float>* %2)
  %6 = load <4 x float>, <4 x float>* %2, align 16
  call void @llvm.lifetime.end(i64 16, i8* %4)

  %7 = extractelement <4 x float> %5, i32 1
  %8 = extractelement <4 x float> %6, i32 1
  %9 = fsub float %8, %7
  ret float %9
}

broadcast_lifetime:
  subq    $24, %rsp
  movq    %rsp, %rdi
  callq   gfunc
  movq    %rsp, %rdi
  callq   gfunc
  vbroadcastss    4(%rsp), %xmm0 ## <-- 1st gfunc result
  vbroadcastss    4(%rsp), %xmm1 ## <-- 2nd gfunc result
  vsubss  %xmm0, %xmm1, %xmm0
  addq    $24, %rsp
  retq

-- 
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/20161003/ebd2993c/attachment-0001.html>


More information about the llvm-bugs mailing list