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

Sanjay Patel <[email protected]> changed:

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

--- Comment #10 from Sanjay Patel <[email protected]> ---
I've attached a test program (test harness in C, actual tests in asm) to check
performance of the current branch optimization that's happening for x86 in the
DAG. To try it out on Linux or Mac:

$ clang 23827_tester.c 23827_tests.s
$ ./a.out

As-is, the test program is modeling this C code:

extern int bar();//{ return 0; }

int foo(int x, int y) {
        if (x != 0 && y != 0) return bar();
        return 1;
}

I used clang to compile that down to asm while toggling the
setJumpIsExpensive() hook.

The 'super' cases are the asm for a bigger compound predicate because the DAG
optimization appears to happily turn any size predicate into multiple branches:

extern int bar();//{ return 0; }

int foo(int w, int x, int y, int z) {
        if (w != 0 && x != 0 && y != 0 && z != 0) return bar();
        return 1;
}

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to