summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove a bogus piece of my AssertSext/AssertZext patch. oops.Nate Begeman2005-08-301-2/+0
| | | | llvm-svn: 23148
* Add support for AssertSext and AssertZext, folding other extensions withNate Begeman2005-08-302-9/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | them. This allows for elminination of redundant extends in the entry blocks of functions on PowerPC. Add support for i32 x i32 -> i64 multiplies, by recognizing when the inputs to ISD::MUL in ExpandOp are actually just extended i32 values and not real i64 values. this allows us to codegen int mulhs(int a, int b) { return ((long long)a * b) >> 32; } as: _mulhs: mulhw r3, r4, r3 blr instead of: _mulhs: mulhwu r2, r4, r3 srawi r5, r3, 31 mullw r5, r4, r5 add r2, r2, r5 srawi r4, r4, 31 mullw r3, r4, r3 add r3, r2, r3 blr with a similar improvement on x86. llvm-svn: 23147
* Name this variable to be what it really is!Chris Lattner2005-08-301-4/+4
| | | | llvm-svn: 23145
* Handle CopyToReg nodes with flag operands correctlyChris Lattner2005-08-301-1/+6
| | | | llvm-svn: 23144
* Add a hack to avoid some horrible code in some cases by always emittingChris Lattner2005-08-291-12/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | token chains first. For this C function: int test() { int i; for (i = 0; i < 100000; ++i) foo(); } Instead of emitting this (condition before call) .LBB_test_1: ; no_exit addi r30, r30, 1 lis r2, 1 ori r2, r2, 34464 cmpw cr2, r30, r2 bl L_foo$stub bne cr2, .LBB_test_1 ; no_exit Emit this: .LBB_test_1: ; no_exit bl L_foo$stub addi r30, r30, 1 lis r2, 1 ori r2, r2, 34464 cmpw cr0, r30, r2 bne cr0, .LBB_test_1 ; no_exit Which makes it so we don't have to save/restore cr2 in the prolog/epilog of the function. This also makes the code much more similar to what the pattern isel produces. llvm-svn: 23135
* Add a new API for NateChris Lattner2005-08-291-0/+27
| | | | llvm-svn: 23131
* Some of us cared about the the promote pathAndrew Lenharth2005-08-291-0/+4
| | | | llvm-svn: 23130
* Fix an infinite loop on x86Chris Lattner2005-08-291-1/+1
| | | | llvm-svn: 23129
* Fix a bug in my previous patch that was using the wrong iterator. This fixesChris Lattner2005-08-291-1/+1
| | | | | | Olden/bisort among others. llvm-svn: 23124
* Fix a bug in ReplaceAllUsesWithChris Lattner2005-08-281-1/+1
| | | | llvm-svn: 23122
* Disable this code, which broke many tests last nightChris Lattner2005-08-271-1/+1
| | | | llvm-svn: 23114
* fix PHI node emission for basic blocks that have select_cc's in them on ppc32Chris Lattner2005-08-271-2/+3
| | | | llvm-svn: 23113
* Nate noticed that Andrew never did this. This fixes PR600Chris Lattner2005-08-261-1/+1
| | | | llvm-svn: 23110
* Don't copy regs that are only used in the entry block into a vreg. ThisChris Lattner2005-08-261-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | changes the code generated for: short %test(short %A) { %B = xor short %A, -32768 ret short %B } to: _test: xori r2, r3, 32768 xoris r2, r2, 65535 extsh r3, r2 blr instead of: _test: rlwinm r2, r3, 0, 16, 31 xori r2, r3, 32768 xoris r2, r2, 65535 extsh r3, r2 blr llvm-svn: 23109
* Make this code safe for when loadRegFromStackSlot inserts multiple instructions.Chris Lattner2005-08-261-1/+13
| | | | llvm-svn: 23108
* Checking types here is not safe, because multiple types can map to the sameChris Lattner2005-08-261-3/+0
| | | | | | register class. llvm-svn: 23103
* Call the InsertAtEndOfBasicBlock hook if the usesCustomDAGSchedInserterChris Lattner2005-08-262-1/+22
| | | | | | flag is set on an instruction. llvm-svn: 23098
* Revampt ReplaceAllUsesWith to be more efficient and easier to use.Chris Lattner2005-08-261-5/+53
| | | | llvm-svn: 23087
* Change ConstantPoolSDNode to actually hold the Constant itself instead ofChris Lattner2005-08-264-27/+24
| | | | | | | | 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
* Fix a huge annoyance: SelectNodeTo took types before the opcode unlikeChris Lattner2005-08-261-19/+17
| | | | | | every other SD API. Fix it to take the opcode before the types. llvm-svn: 23079
* the 5th operand is the 4th numberChris Lattner2005-08-261-1/+1
| | | | llvm-svn: 23074
* Add support for targets that want to custom expand select_cc in some cases.Chris Lattner2005-08-261-6/+24
| | | | llvm-svn: 23071
* Allow LowerOperation to return a null SDOperand in case it wants to lowerChris Lattner2005-08-261-21/+39
| | | | | | some things given to it, but not all. llvm-svn: 23070
* Fix a nasty bug from a previous patch of mineChris Lattner2005-08-261-1/+1
| | | | llvm-svn: 23069
* New fold for SELECT_CCNate Begeman2005-08-251-1/+19
| | | | llvm-svn: 23058
* Don't auto-cse nodes that return flagsChris Lattner2005-08-251-17/+38
| | | | llvm-svn: 23055
* add printer support for flag operandsChris Lattner2005-08-251-0/+1
| | | | llvm-svn: 23054
* simplify the code a bit using isOperationLegalChris Lattner2005-08-251-4/+3
| | | | llvm-svn: 23053
* Add support for flag operandsChris Lattner2005-08-251-8/+18
| | | | llvm-svn: 23050
* ADd support for TargetConstantPool nodesChris Lattner2005-08-251-1/+14
| | | | llvm-svn: 23041
* add a new TargetFrameIndex nodeChris Lattner2005-08-251-1/+13
| | | | llvm-svn: 23035
* add a methodChris Lattner2005-08-241-0/+6
| | | | llvm-svn: 23027
* Add ReplaceAllUsesWith that can take a vector of replacement values.Chris Lattner2005-08-241-15/+90
| | | | | | Add some foldings to hopefully help the illegal setcc issue, and move some code around. llvm-svn: 23025
* Add support for external symbols, and support for variable arity instructionsChris Lattner2005-08-241-5/+12
| | | | llvm-svn: 23022
* Fix pasto that prevented VT ndoes from showing up in -view-isel-dags correctlyChris Lattner2005-08-241-1/+1
| | | | llvm-svn: 23021
* teach selection dag mask tracking about the fact that select_cc operates likeChris Lattner2005-08-241-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | select. Also teach it that the bit count instructions can only set the low bits of the result, depending on the size of the input. This allows us to compile this: int %eq0(int %a) { %tmp.1 = seteq int %a, 0 ; <bool> [#uses=1] %tmp.2 = cast bool %tmp.1 to int ; <int> [#uses=1] ret int %tmp.2 } To this: _eq0: cntlzw r2, r3 srwi r3, r2, 5 blr instead of this: _eq0: cntlzw r2, r3 rlwinm r3, r2, 27, 31, 31 blr when setcc is marked illegal on ppc (which restores parity to non-illegal setcc). Thanks to Nate for pointing this out. llvm-svn: 23013
* Start using isOperationLegal and isTypeLegal to simplify the codeChris Lattner2005-08-241-28/+23
| | | | llvm-svn: 23012
* Teach SelectionDAG how to simplify a few more setcc-equivalent select_ccNate Begeman2005-08-241-6/+21
| | | | | | nodes so that backends don't have to. llvm-svn: 22999
* Make -view-isel-dags show the dag before instruction selecting, in caseChris Lattner2005-08-241-2/+2
| | | | | | the target isel crashes due to unimplemented features like calls :) llvm-svn: 22997
* Fix optimization of select_cc seteq X, 0, 1, 0 -> srl (ctlz X), log2 X sizeNate Begeman2005-08-241-3/+3
| | | | llvm-svn: 22995
* Implement LiveVariables.h changeChris Lattner2005-08-241-0/+30
| | | | llvm-svn: 22994
* adjust to new live variables interfaceChris Lattner2005-08-233-35/+32
| | | | llvm-svn: 22992
* Simplify this code by using higher-level LiveVariables methodsChris Lattner2005-08-231-20/+10
| | | | llvm-svn: 22989
* Keep track of which registers are related to which other registers.Chris Lattner2005-08-231-21/+86
| | | | | | | | | | | | | Use this information to avoid doing expensive interval intersections for registers that could not possible be interesting. This speeds up linscan on ia64 compiling kc++ in release mode from taking 7.82s to 4.8s(!), total itanium llc time on this program is 27.3s now. This marginally speeds up PPC and X86, but they appear to be limited by other parts of linscan, not this code. On this program, on itanium, live intervals now takes 41% of llc time. llvm-svn: 22986
* Teach the SelectionDAG how to transform select_cc eq, X, 0, 1, 0 intoNate Begeman2005-08-231-0/+17
| | | | | | | either seteq X, 0 or srl (ctlz X), size(X-1), depending on what's legal for the target. llvm-svn: 22978
* Teach Legalize how to turn setcc into select_ccNate Begeman2005-08-231-18/+31
| | | | llvm-svn: 22977
* Try to avoid scanning the fixed list. On architectures with a non-stupidChris Lattner2005-08-221-20/+55
| | | | | | | | | | | | | number of regs (e.g. most riscs), many functions won't need to use callee clobbered registers. Do a speculative check to see if we can get a free register without processing the fixed list (which has all of these). This saves a lot of time on machines with lots of callee clobbered regs (e.g. ppc and itanium, also x86). This reduces ppc llc compile time from 184s -> 172s on kc++. This is probably worth FAR FAR more on itanium though. llvm-svn: 22972
* Move some code in the register assignment case that only needs to happen ifChris Lattner2005-08-221-17/+26
| | | | | | | | we spill out of the fast path. The scan of active_ and the calls to updateSpillWeights don't need to happen unless a spill occurs. This reduces debug llc time of kc++ with ppc from 187.3s to 183.2s. llvm-svn: 22971
* Fix a problem where constant expr shifts would not have their shift amountChris Lattner2005-08-221-5/+5
| | | | | | promoted to the right type. This fixes: IA64/2005-08-22-LegalizerCrash.ll llvm-svn: 22969
* Speed up this loop a bit, based on some observations that Nate made, andChris Lattner2005-08-221-8/+34
| | | | | | add some comments. This loop really needs to be reevaluated! llvm-svn: 22966
OpenPOWER on IntegriCloud