|  | Commit message (Collapse) | Author | Age | Files | Lines | 
|---|
| | 
| 
| 
| | llvm-svn: 23304 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| | are allowed to generate 64-bit-only PowerPC instructions for 32 bit hosts,
such as the PowerPC 970.
This speeds up 189.lucas from 81.99 to 32.64 seconds.
llvm-svn: 23250 | 
| | 
| 
| 
| 
| 
| | getting them out of the business of making stack slots.
llvm-svn: 23180 | 
| | 
| 
| 
| | llvm-svn: 23179 | 
| | 
| 
| 
| | llvm-svn: 23177 | 
| | 
| 
| 
| | llvm-svn: 23170 | 
| | 
| 
| 
| 
| 
| 
| 
| | giving it a non-instruction opcode.  The dag->dag selector used to not
select the operands of the fsel, because it thought that whole tree was
already selected.
llvm-svn: 23091 | 
| | 
| 
| 
| | llvm-svn: 23085 | 
| | 
| 
| 
| | llvm-svn: 23084 | 
| | 
| 
| 
| 
| 
| 
| 
| | putting it into the constant pool.  This allows the isel machinery to
create constants that it will end up deciding are not needed, without them
ending up in the resultant function constant pool.
llvm-svn: 23081 | 
| | 
| 
| 
| | llvm-svn: 23080 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| | instead of in the backend.  This currently handles fsel cases with registers,
but doesn't have the 0.0 and -0.0 optimization enabled yet.
Once this is finished, special hack for fp immediates can go away.
llvm-svn: 23075 | 
| | 
| 
| 
| | llvm-svn: 23065 | 
| | 
| 
| 
| 
| 
| | doesn't work for large uint constants, but we'll keep the current behavior
llvm-svn: 23061 | 
| | 
| 
| 
| | llvm-svn: 23051 | 
| | 
| 
| 
| 
| 
| 
| | instructions take a consistent reg class.  Implement ISD::UNDEF in the dag->dag
selector to generate this, fixing UnitTests/2003-07-06-IntOverflow.
llvm-svn: 23028 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | Emit the indcall sequence as:
mtctr inreg
mr R12, inreg
btctr
If inreg and R12 aren't coallesced, this reduces the odds of having the mtctr
and btctr in the same dispatch group.  :)
llvm-svn: 23023 | 
| | 
| 
| 
| 
| 
| | target independent code in SelectionDAG.cpp
llvm-svn: 23002 | 
| | 
| 
| 
| 
| 
| | Prefer 'neg X' to 'subfic 0, X' since it does not set XER[CA]
llvm-svn: 23000 | 
| | 
| 
| 
| 
| 
| | that is conditionally executed
llvm-svn: 22960 | 
| | 
| 
| 
| 
| 
| 
| 
| | simplifies BRTWOWAY into BR if one of the results is a fall-through.
Unless I'm missing something, there is no reason to duplicate this
in the target-specific code.
llvm-svn: 22952 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | it in the block.  This codegens:
int %test(bool %c) {
        %retval = select bool %c, int 17, int 1
        ret int %retval
}
as:
_test:
        rlwinm r2, r3, 0, 31, 31
        li r2, 17
        cmpwi cr0, r3, 0
        bne .LBB_test_2 ;
.LBB_test_1:    ;
        li r2, 1
.LBB_test_2:    ;
        or r3, r2, r2
        blr
instead of:
_test:
        rlwinm r2, r3, 0, 31, 31
        li r2, 17
        li r4, 1
        cmpwi cr0, r3, 0
        bne .LBB_test_2 ;
.LBB_test_1:    ;
        or r2, r4, r4
.LBB_test_2:    ;
        or r3, r2, r2
        blr
... which is one fewer instruction.  The savings are more significant for
global address and constantfp nodes.
llvm-svn: 22946 | 
| | 
| 
| 
| 
| 
| | instruction.
llvm-svn: 22901 | 
| | 
| 
| 
| | llvm-svn: 22882 | 
| | 
| 
| 
| | llvm-svn: 22870 | 
| | 
| 
| 
| 
| 
| 
| 
| | as the argument to LIS rather than the result of HA16(constant).
The DAG->DAG ISel was already doing the right thing.
llvm-svn: 22865 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | Now for int foo() { return -1; } we generate:
_foo:
        li r3, -1
        blr
instead of
_foo:
        lis r2, -1
        ori r3, r2, 65535
        blr
llvm-svn: 22864 | 
| | 
| 
| 
| 
| 
| | to make the code follow people's expectations better.
llvm-svn: 22861 | 
| | 
| 
| 
| | llvm-svn: 22858 | 
| | 
| 
| 
| | llvm-svn: 22848 | 
| | 
| 
| 
| 
| 
| 
| | selector.  Also, there is no difference between addSImm and addImm, so just
use addImm, folding some branches.
llvm-svn: 22819 | 
| | 
| 
| 
| | llvm-svn: 22818 | 
| | 
| 
| 
| 
| 
| | marked as legal.
llvm-svn: 22816 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | Remove dead code in ISD::Constant handling
Add support for add long, imm16
We now codegen 'long long foo(long long a) { return ++a; }'
as:
addic r4, r4, 1
addze r3, r3
blr
instead of:
li r2, 1
li r5, 0
addc r2, r4, r2
adde r3, r3, r5
blr
llvm-svn: 22811 | 
| | 
| 
| 
| | llvm-svn: 22808 | 
| | 
| 
| 
| 
| 
| 
| | fixme from the PowerPC backend.  Emit slightly better code for legalizing
select_cc.
llvm-svn: 22805 | 
| | 
| 
| 
| 
| 
| | can be shared with the DAG->DAG selector.
llvm-svn: 22799 | 
| | 
| 
| 
| | llvm-svn: 22792 | 
| | 
| 
| 
| 
| 
| | consistent with gcc.
llvm-svn: 22791 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| | 1. Not selecting the false value of a select_cc in the false arm, which
   isn't legal for nested selects.
2. Actually returning the node we created and Legalized in the FP_TO_UINT
   Expander.
llvm-svn: 22789 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | codegen for FP_TO_UINT by using the legalizer's SELECT variant.
Implement a codegen improvement for SELECT_CC, selecting the false node in
the MBB that feeds the phi node.  This allows us to codegen:
void foo(int *a, int b, int c) { int d = (a < b) ? 5 : 9; *a = d; }
as:
_foo:
        li r2, 5
        cmpw cr0, r4, r3
        bgt .LBB_foo_2  ; entry
.LBB_foo_1:     ; entry
        li r2, 9
.LBB_foo_2:     ; entry
        stw r2, 0(r3)
        blr
insted of:
_foo:
        li r2, 5
        li r5, 9
        cmpw cr0, r4, r3
        bgt .LBB_foo_2  ; entry
.LBB_foo_1:     ; entry
        or r2, r5, r5
.LBB_foo_2:     ; entry
        stw r2, 0(r3)
        blr
llvm-svn: 22784 | 
| | 
| 
| 
| 
| 
| | zero.
llvm-svn: 22773 | 
| | 
| 
| 
| 
| 
| | (~x)|y and x|(~y) yielding ORC.
llvm-svn: 22771 | 
| | 
| 
| 
| 
| 
| 
| 
| | specified opcode and an integer constant right operand.
2. Modified ISD::SHL, ISD::SRL, ISD::SRA to use rlwinm when applied after a mask.
llvm-svn: 22761 | 
| | 
| 
| 
| 
| 
| | Patch by Jim Laskey.
llvm-svn: 22760 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | (avoids an extra level of indirection in MakeReg).
  defined MakeIntReg using RegMap->createVirtualRegister(PPC32::GPRCRegisterClass)
  defined MakeFPReg using RegMap->createVirtualRegister(PPC32::FPRCRegisterClass)
  s/MakeReg(MVT::i32)/MakeIntReg/
  s/MakeReg(MVT::f64)/MakeFPReg/
Patch by Jim Laskey!
llvm-svn: 22759 | 
| | 
| 
| 
| 
| 
| 
| | reflects what the hardware is capable of.  This significantly simplifies
the CC handling logic throughout the ISel.
llvm-svn: 22756 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| | 1. Clean up how SelectIntImmediateExpr handles use counts.
2. "Subtract from" was not clearing hi 16 bits.
Patch by Jim Laskey
llvm-svn: 22754 | 
| | 
| 
| 
| 
| 
| | Patch by Jim Laskey!
llvm-svn: 22750 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | New routine: ISel::SelectIntImmediateExpr
  2. Now checking use counts of large constants.  If use count is > 2 then drop
  thru so that the constant gets loaded into a register.
  Source:
int %test1(int %a) {
entry:
       %tmp.1 = add int %a,      123456789      ; <int> [#uses=1]
       %tmp.2 = or  int %tmp.1,  123456789      ; <int> [#uses=1]
       %tmp.3 = xor int %tmp.2,  123456789      ; <int> [#uses=1]
       %tmp.4 = sub int %tmp.3, -123456789      ; <int> [#uses=1]
       ret int %tmp.4
}
Did Emit:
       .machine ppc970
       .text
       .align  2
       .globl  _test1
_test1:
.LBB_test1_0:   ; entry
       addi r2, r3, -13035
       addis r2, r2, 1884
       ori r2, r2, 52501
       oris r2, r2, 1883
       xori r2, r2, 52501
       xoris r2, r2, 1883
       addi r2, r2, 52501
       addis r3, r2, 1883
       blr
Now Emits:
       .machine ppc970
       .text
       .align  2
       .globl  _test1
_test1:
.LBB_test1_0:   ; entry
       lis r2, 1883
       ori r2, r2, 52501
       add r3, r3, r2
       or r3, r3, r2
       xor r3, r3, r2
       add r3, r3, r2
       blr
Patch by Jim Laskey!
llvm-svn: 22749 |