[llvm-bugs] [Bug 40083] [x86] psubus matching failure with undef elements

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Jan 27 13:07:02 PST 2019


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

Simon Pilgrim <llvm-dev at redking.me.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
 Fixed By Commit(s)|                            |r352328,r352330
         Resolution|---                         |FIXED

--- Comment #1 from Simon Pilgrim <llvm-dev at redking.me.uk> ---
Fixed in rL352328 (combineAddToSUBUS) and rL352330 (combineSelect)

Note: The C++ example now emits:

unsigned long long test_sub_2(__m128i x) {
    __m128i c = _mm_set1_epi8(70);
    return _mm_subs_epu8(x, c)[0];
}

define i64 @test_sub_2(<2 x i64>) {
  %2 = bitcast <2 x i64> %0 to <16 x i8>
  %3 = tail call <16 x i8> @llvm.usub.sat.v16i8(<16 x i8> %2, <16 x i8> <i8 70,
i8 70, i8 70, i8 70, i8 70, i8 70, i8 70, i8 70, i8 70, i8 70, i8 70, i8 70, i8
70, i8 70, i8 70, i8 70>) #4
  %4 = bitcast <16 x i8> %3 to <2 x i64>
  %5 = extractelement <2 x i64> %4, i32 0
  ret i64 %5
}

And the test case had typos which had to be fixed:

define i64 @test31(<2 x i64> %x) {
  %t0 = bitcast <2 x i64> %x to <16 x i8>
  %cmp = icmp ugt <16 x i8> %t0, <i8 70, i8 70, i8 70, i8 70, i8 70, i8 70, i8
70, i8 70, i8 undef, i8 undef, i8 undef, i8 undef, i8 undef, i8 undef, i8
undef, i8 undef>
  %bop = add <16 x i8> %t0, <i8 -71, i8 -71, i8 -71, i8 -71, i8 -71, i8 -71, i8
-71, i8 -71, i8 undef, i8 undef, i8 undef, i8 undef, i8 undef, i8 undef, i8
undef, i8 undef>
  %sel = select <16 x i1> %cmp, <16 x i8> %bop, <16 x i8> zeroinitializer
  %bc = bitcast <16 x i8> %sel to <2 x i64>
  %ext = extractelement <2 x i64> %bc, i32 0
  ret i64 %ext
}

-- 
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/20190127/6da30c80/attachment.html>


More information about the llvm-bugs mailing list