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: [email protected]
          Reporter: [email protected]
                CC: [email protected]

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.
_______________________________________________
llvm-bugs mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to