[llvm-bugs] [Bug 40994] New: llvm.masked.compressstore.v16i8 fails to select on x86 with SSE4.2

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Mar 7 07:57:42 PST 2019


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

            Bug ID: 40994
           Summary: llvm.masked.compressstore.v16i8 fails to select on x86
                    with SSE4.2
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: X86
          Assignee: unassignedbugs at nondot.org
          Reporter: gonzalobg88 at gmail.com
                CC: craig.topper at gmail.com, llvm-bugs at lists.llvm.org,
                    llvm-dev at redking.me.uk, spatel+llvm at rotateright.com

This (godbolt: https://godbolt.org/z/DQF-KK):

declare void @llvm.masked.compressstore.v16i8(<16 x i8>, i8*, <16 x i1>) #0

define <8 x i8> @foo(<16 x i8> %a) {
  %v = alloca i8, i32 8, align 16
  call void @llvm.masked.compressstore.v16i8(<16 x i8> %a, i8* %v, <16 x i1>
<i1 true, i1 false, i1 true, i1 false, i1 true, i1 false, i1 true, i1 false, i1
true, i1 false, i1 true, i1 false, i1 true, i1 false, i1 true, i1 false>)
  %ptr = bitcast i8* %v to <8 x i8>*
  %out = load <8 x i8>, <8 x i8>* %ptr
  ret <8 x i8> %out
}

attributes #0 = { argmemonly nounwind }

fails with: 

LLVM ERROR: Cannot select: 0x563fc1c63d20: ch = masked_store<(store 16 into
%ir.v), compressing> 0x563fc1bed668, 0x563fc1c63b18, FrameIndex:i64<0>,
0x563fc1c63c50

  0x563fc1c63b18: v16i8,ch = CopyFromReg 0x563fc1bed668, Register:v16i8 %0

    0x563fc1c63ab0: v16i8 = Register %0

  0x563fc1c63b80: i64 = FrameIndex<0>

  0x563fc1c63c50: v16i8,ch = load<(load 16 from constant-pool)> 0x563fc1bed668,
0x563fc1c64198, undef:i64

    0x563fc1c64198: i64 = X86ISD::Wrapper TargetConstantPool:i64<<16 x i8> <i8
-1, i8 0, i8 -1, i8 0, i8 -1, i8 0, i8 -1, i8 0, i8 -1, i8 0, i8 -1, i8 0, i8
-1, i8 0, i8 -1, i8 0>> 0

      0x563fc1c63d88: i64 = TargetConstantPool<<16 x i8> <i8 -1, i8 0, i8 -1,
i8 0, i8 -1, i8 0, i8 -1, i8 0, i8 -1, i8 0, i8 -1, i8 0, i8 -1, i8 0, i8 -1,
i8 0>> 0

    0x563fc1c63df0: i64 = undef

In function: foo

Compiler returned: 1

---

I'll expect LLVM to be able to lower this to pshufb on SSSE3, and something
better in AVX.

-- 
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/20190307/dc57c95c/attachment.html>


More information about the llvm-bugs mailing list