[llvm-bugs] [Bug 30579] New: x86 backend legalises `xor i1` incorrectly

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Sep 30 10:14:42 PDT 2016


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

            Bug ID: 30579
           Summary: x86 backend legalises `xor i1` incorrectly
           Product: libraries
           Version: 3.9
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: X86
          Assignee: unassignedbugs at nondot.org
          Reporter: simonas+llvm.org at kazlauskas.me
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Created attachment 17389
  --> https://llvm.org/bugs/attachment.cgi?id=17389&action=edit
The LLVM IR reproducing the issue

The attached LLVM-IR sample, when compiled with `llc  -filetype=asm -o -
test.ll -O0` (the -O0 is important here) produces the following assembly (with
unnecessary details removed): 

    banana:
        pushq    %rbp
        movq    %rsp, %rbp
    .Ltmp2:
        movb    $1, -1(%rbp)
        movb    -1(%rbp), %al  # %al = 1
        movb    F, %cl         # %cl = 0
        xorb    $-1, %cl       # %cl = 255 ^ 0 = 255
                               # missing andb $1, %cl
        cmpb    %cl, %al
        je    .LBB0_2
        ud2
    .LBB0_2:
        popq    %rbp
        retq
    .Lfunc_end0:

    F:
        .byte    0
        .size    F, 1

The `%2 = xor i1 %f, true` from original LLVM-IR seems to be legalised
incorrectly, as it is missing a `andb $1, %cl` after the `xorb` instruction.

-- 
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/20160930/02fa5c67/attachment.html>


More information about the llvm-bugs mailing list