llvm-6502/lib
Chris Lattner 3b2c1d95a2 canonicalize x <u 1 -> x == 0. On this testcase:
unsigned long long g;
unsigned long foo (unsigned long a) {
  return (a >= g) ? 1 : 0;
}

It changes the ppc code from:

_foo:
.LBB_foo_0:     ; entry
        mflr r11
        stw r11, 8(r1)
        bl "L00000$pb"
"L00000$pb":
        mflr r2
        addis r2, r2, ha16(L_g$non_lazy_ptr-"L00000$pb")
        lwz r2, lo16(L_g$non_lazy_ptr-"L00000$pb")(r2)
        lwz r4, 0(r2)
        lwz r2, 4(r2)
        cmplw cr0, r3, r2
        li r2, 1
        li r3, 0
        bge .LBB_foo_2  ; entry
.LBB_foo_1:     ; entry
        or r2, r3, r3
.LBB_foo_2:     ; entry
        cmplwi cr0, r4, 1
        li r3, 1
        li r5, 0
        blt .LBB_foo_4  ; entry
.LBB_foo_3:     ; entry
        or r3, r5, r5
.LBB_foo_4:     ; entry
        cmpwi cr0, r4, 0
        beq .LBB_foo_6  ; entry
.LBB_foo_5:     ; entry
        or r2, r3, r3
.LBB_foo_6:     ; entry
        rlwinm r3, r2, 0, 31, 31
        lwz r11, 8(r1)
        mtlr r11
        blr


to:

_foo:
.LBB_foo_0:     ; entry
        mflr r11
        stw r11, 8(r1)
        bl "L00000$pb"
"L00000$pb":
        mflr r2
        addis r2, r2, ha16(L_g$non_lazy_ptr-"L00000$pb")
        lwz r2, lo16(L_g$non_lazy_ptr-"L00000$pb")(r2)
        lwz r4, 0(r2)
        lwz r2, 4(r2)
        cmplw cr0, r3, r2
        li r2, 1
        li r3, 0
        bge .LBB_foo_2  ; entry
.LBB_foo_1:     ; entry
        or r2, r3, r3
.LBB_foo_2:     ; entry
        cntlzw r3, r4
        srwi r3, r3, 5
        cmpwi cr0, r4, 0
        beq .LBB_foo_4  ; entry
.LBB_foo_3:     ; entry
        or r2, r3, r3
.LBB_foo_4:     ; entry
        rlwinm r3, r2, 0, 31, 31
        lwz r11, 8(r1)
        mtlr r11
        blr


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21241 91177308-0d34-0410-b5e6-96231b3b80d8
2005-04-12 00:28:49 +00:00
..
Analysis Don't make this require loopsimplify. It works BETTER with loop simplify 2005-04-06 21:45:00 +00:00
Archive Implement an isBytecodeArchive method to determine if an archive contains 2005-02-26 22:00:32 +00:00
AsmParser don't crash in some bad cases. 2005-03-23 01:29:26 +00:00
Bytecode This mega patch converts us from using Function::a{iterator|begin|end} to 2005-03-15 04:54:21 +00:00
CodeGen canonicalize x <u 1 -> x == 0. On this testcase: 2005-04-12 00:28:49 +00:00
Debugger Correct the comments and file header. 2004-12-23 21:16:46 +00:00
ExecutionEngine Fix the missing symbols problem Bill was hitting. Patch contributed by 2005-03-17 15:38:16 +00:00
Linker fix some 80 column violations 2005-03-15 23:03:34 +00:00
Support Timers SHOULD NOT record the time taken to count the bytes allocated in the heap! 2005-03-22 03:20:38 +00:00
System Eliminate tabs 2005-04-11 03:44:22 +00:00
Target Implement bitfield clears 2005-04-12 00:10:02 +00:00
Transforms Fix bug: InstCombine/2005-05-07-UDivSelectCrash.ll 2005-04-08 04:03:26 +00:00
VMCore First step in adding pcmarker intrinsic. Second step (soon) is adding backend support. 2005-03-28 20:05:49 +00:00
Makefile Add the Linker library 2004-11-14 21:54:41 +00:00