llvm-6502/lib
Chris Lattner cf9d0acfef Fold the PPCISD shifts when presented with 0 inputs. This occurs for code
like:
long long test(long long X, int Y) {
  return 1ULL << Y;
}
long long test2(long long X, int Y) {
  return -1LL << Y;
}

which we used to compile to:

_test:
        li r2, 1
        subfic r3, r5, 32
        li r4, 0
        addi r6, r5, -32
        srw r3, r2, r3
        slw r4, r4, r5
        slw r6, r2, r6
        or r3, r4, r3
        slw r4, r2, r5
        or r3, r3, r6
        blr
_test2:
        li r2, -1
        subfic r3, r5, 32
        addi r6, r5, -32
        srw r3, r2, r3
        slw r4, r2, r5
        slw r2, r2, r6
        or r3, r4, r3
        or r3, r3, r2
        blr

Now we produce:

_test:
        li r2, 1
        addi r3, r5, -32
        subfic r4, r5, 32
        slw r3, r2, r3
        srw r4, r2, r4
        or r3, r4, r3
        slw r4, r2, r5
        blr
_test2:
        li r2, -1
        subfic r3, r5, 32
        addi r6, r5, -32
        srw r3, r2, r3
        slw r4, r2, r5
        slw r2, r2, r6
        or r3, r4, r3
        or r3, r3, r2
        blr


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30479 91177308-0d34-0410-b5e6-96231b3b80d8
2006-09-19 05:22:59 +00:00
..
Analysis Explain change with a comment. 2006-09-17 17:51:00 +00:00
Archive For PR797: 2006-08-25 19:54:53 +00:00
AsmParser Added some eye-candy for Subtarget type checking 2006-09-17 20:25:45 +00:00
Bytecode Small fixes for supporting dll* linkage types 2006-09-17 13:06:18 +00:00
CodeGen Fold extract_element(cst) to cst 2006-09-19 05:02:39 +00:00
Debugger For PR797: 2006-08-25 17:43:11 +00:00
ExecutionEngine Unbreak the JIT 2006-09-15 04:56:11 +00:00
Linker Adding dllimport, dllexport and external weak linkage types. 2006-09-14 18:23:27 +00:00
Support Instantiate Statistic<> in one place, not in every .o file that uses it. 2006-08-30 04:17:00 +00:00
System Use new config.h macro 2006-09-14 06:21:59 +00:00
Target Fold the PPCISD shifts when presented with 0 inputs. This occurs for code 2006-09-19 05:22:59 +00:00
Transforms Walk down the dominator tree instead of the control flow graph. That means 2006-09-18 21:09:35 +00:00
VMCore add a helper method 2006-09-18 04:54:57 +00:00
Makefile Make some changes suggested by Chris: 2006-05-17 22:55:35 +00:00