[llvm-bugs] [Bug 38334] New: Propagate null pattern into condition blocks

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Jul 27 00:52:28 PDT 2018


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

            Bug ID: 38334
           Summary: Propagate null pattern into condition blocks
           Product: libraries
           Version: 6.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: david.bolvansky at gmail.com
                CC: llvm-bugs at lists.llvm.org

Code:
void * foo2(void *p, void *q, void *r) {

    if (!p && !q) 

        return p;
    return NULL;
}

Currently:
foo2:                                   # @foo2
        xor     eax, eax
        or      rsi, rdi
        cmove   rax, rdi
        ret

Should be:
foo2:                                   # @foo2
        xor     eax, eax
        ret

Proof of legality:
https://rise4fun.com/Alive/jB8

-- 
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/20180727/f938b405/attachment.html>


More information about the llvm-bugs mailing list