[LLVMbugs] [Bug 17109] generate more efficient code for logical and operation

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Sep 5 11:41:51 PDT 2013


http://llvm.org/bugs/show_bug.cgi?id=17109

Kay Tiong Khoo <kkhoo at perfwizard.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID

--- Comment #5 from Kay Tiong Khoo <kkhoo at perfwizard.com> ---
Here's what I must've been dreaming of:

$ cat or.c 
#include <stdbool.h>

bool or(unsigned int x, unsigned int y) {
        return (x != 0 || y != 0);
}

$ ./clang -S -O3 -fomit-frame-pointer  or.c -o /dev/stdout 
    .section    __TEXT,__text,regular,pure_instructions
    .globl    _or
    .align    4, 0x90
_or:                                    ## @or
    .cfi_startproc
## BB#0:                                ## %entry
    orl    %esi, %edi
    setne    %al
    ret

Good job, compiler! :)

-- 
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/20130905/129d3b6f/attachment.html>


More information about the llvm-bugs mailing list