[LLVMbugs] [Bug 11210] New: [AVX] opportunity for better code with masked stores

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Oct 22 12:13:58 PDT 2011


http://llvm.org/bugs/show_bug.cgi?id=11210

           Summary: [AVX] opportunity for better code with masked stores
           Product: new-bugs
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: matt at pharr.org
                CC: llvmbugs at cs.uiuc.edu


(Trying again, with description text this time).

Consider the following bitcode:

declare <8 x float> @llvm.x86.avx.maskload.ps.256(i8 *, <8 x float> %mask)
declare void @llvm.x86.avx.maskstore.ps.256(i8 *, <8 x float>, <8 x float>)

define void @foo(i8 * %ptr, <8 x float> %val, <8 x float> %mask) {
  %v0 = call <8 x float> @llvm.x86.avx.maskload.ps.256(i8 * %ptr, <8 x float>
%mask)
  %v1 = fadd <8 x float> %v0, %v0
  call void @llvm.x86.avx.maskstore.ps.256(i8 * %ptr, <8 x float> %mask, <8 x
float> %val)
  call void @llvm.x86.avx.maskstore.ps.256(i8 * %ptr, <8 x float> %mask, <8 x
float> %v1)
  ret void
}

llc -mattr=+avx generates the following:

    vmaskmovps    (%rdi), %ymm1, %ymm2
    vmaskmovps    %ymm0, %ymm1, (%rdi)
    vaddps    %ymm2, %ymm2, %ymm0
    vmaskmovps    %ymm0, %ymm1, (%rdi)

Here, the first "vmaskmovps %ymm0, %ymm1, (%rdi)" instruction has no effect, as
the vmaskmovps after the vaddps overwrites the exact same locations (since it's
using the same mask as the first store).

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list