summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix CodeGen/X86/shift-folding.ll:test3 on X86Chris Lattner2005-11-091-1/+1
| | | | llvm-svn: 24256
* Disable some overly-aggressive checking code. This speeds up the localChris Lattner2005-11-091-1/+2
| | | | | | allocator from 23s to 11s on kc++ in debug mode. llvm-svn: 24255
* Avoid creating a token factor node in trivially redundant cases. ThisChris Lattner2005-11-091-1/+12
| | | | | | eliminates almost one node per block in common cases. llvm-svn: 24254
* Handle GEP's a bit more intelligently. Fold constant indices early andChris Lattner2005-11-091-16/+40
| | | | | | turn power-of-two multiplies into shifts early to improve compile time. llvm-svn: 24253
* Allocate the right amount of memory for this vector up front.Chris Lattner2005-11-081-0/+1
| | | | llvm-svn: 24252
* Change the ValueList array for each node to be shared instead of ↵Chris Lattner2005-11-081-5/+48
| | | | | | individuallyallocated. Further, in the common case where a node has a single value, justreference an element from a small array. This is a small compile-time win. llvm-svn: 24251
* Switch the operandlist/valuelist from being vectors to being just an ↵Chris Lattner2005-11-081-23/+33
| | | | | | | | | array.This saves 12 bytes from SDNode, but doesn't speed things up substantially (our graphs apparently already fit within the cache on my g5). In any case this reduces memory usage. llvm-svn: 24249
* Explicitly initialize some instance varsChris Lattner2005-11-081-4/+5
| | | | llvm-svn: 24247
* Clean up RemoveDeadNodes significantly, by eliminating the need for a temporaryChris Lattner2005-11-081-32/+34
| | | | | | | | set and eliminating the need to iterate whenever something is removed (which can be really slow in some cases). Thx to Jim for pointing out something silly I was getting stuck on. :) llvm-svn: 24241
* Let's try ignoring resource utilization on the backward pass.Jim Laskey2005-11-071-0/+2
| | | | llvm-svn: 24231
* Always compute max align.Chris Lattner2005-11-061-6/+5
| | | | llvm-svn: 24227
* Add the necessary support to the ISel to allow targets to codegen the newNate Begeman2005-11-062-5/+16
| | | | | | | | alignment information appropriately. Includes code for PowerPC to support fixed-size allocas with alignment larger than the stack. Support for arbitrarily aligned dynamic allocas coming soon. llvm-svn: 24224
* Fix logic bug in finding retry slot in tally.Jim Laskey2005-11-051-15/+33
| | | | llvm-svn: 24188
* Fix a warningJim Laskey2005-11-041-0/+1
| | | | llvm-svn: 24187
* Scheduling now uses itinerary data.Jim Laskey2005-11-041-166/+201
| | | | llvm-svn: 24180
* Fix a crash that Andrew noticed, and add a pair of braces to unfconfuseNate Begeman2005-11-021-5/+5
| | | | | | XCode's indenting. llvm-svn: 24159
* Fix a source of undefined behavior when dealing with 64-bit types. ThisChris Lattner2005-11-021-1/+1
| | | | | | may fix PR652. Thanks to Andrew for tracking down the problem. llvm-svn: 24145
* 1. Embed and not inherit vector for NodeGroup.Jim Laskey2005-10-311-20/+39
| | | | | | | | 2. Iterate operands and not uses (performance.) 3. Some long pending comment changes. llvm-svn: 24119
* Significantly simplify this code and make it more aggressive. Instead of havingChris Lattner2005-10-301-103/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a special case hack for X86, make the hack more general: if an incoming argument register is not used in any block other than the entry block, don't copy it to a vreg. This helps us compile code like this: %struct.foo = type { int, int, [0 x ubyte] } int %test(%struct.foo* %X) { %tmp1 = getelementptr %struct.foo* %X, int 0, uint 2, int 100 %tmp = load ubyte* %tmp1 ; <ubyte> [#uses=1] %tmp2 = cast ubyte %tmp to int ; <int> [#uses=1] ret int %tmp2 } to: _test: lbz r3, 108(r3) blr instead of: _test: lbz r2, 108(r3) or r3, r2, r2 blr The (dead) copy emitted to copy r3 into a vreg for extra-block uses was increasing the live range of r3 past the load, preventing the coallescing. This implements CodeGen/PowerPC/reg-coallesce-simple.ll llvm-svn: 24115
* Reduce the number of copies emitted as machine instructions byChris Lattner2005-10-301-16/+57
| | | | | | | | | | | | | | | | | generating results in vregs that will need them. In the case of something like this: CopyToReg((add X, Y), reg1024), we no longer emit code like this: reg1025 = add X, Y reg1024 = reg 1025 Instead, we emit: reg1024 = add X, Y Whoa! :) llvm-svn: 24111
* Codegen mul by negative power of two with a shift and negate.Chris Lattner2005-10-301-3/+13
| | | | | | | | | | | | | | | | | | | This implements test/Regression/CodeGen/PowerPC/mul-neg-power-2.ll, producing: _foo: slwi r2, r3, 1 subfic r3, r2, 63 blr instead of: _foo: mulli r2, r3, -2 addi r3, r2, 63 blr llvm-svn: 24106
* Fix DSE to not nuke dead stores unless they redundant store is the sameChris Lattner2005-10-271-1/+4
| | | | | | VT as the killing one. Fix fixes PR491 llvm-svn: 24034
* Add a simple xform that is useful for bitfield operations.Chris Lattner2005-10-271-0/+9
| | | | llvm-svn: 24029
* Fix some spello's pointed out by Gabor GreifChris Lattner2005-10-262-4/+4
| | | | llvm-svn: 24019
* Allow custom lowered FP_TO_SINT ops in the check for whether a largerNate Begeman2005-10-251-1/+2
| | | | | | | FP_TO_SINT is preferred to a larger FP_TO_UINT. This seems to be begging for a TLI.isOperationCustom() helper function. llvm-svn: 23992
* Clear a bit in this file that was causing a miscompilation of 178.galgel.Chris Lattner2005-10-251-1/+1
| | | | llvm-svn: 23980
* Alkis agrees that that iterative scan allocator isn't going to be worked onChris Lattner2005-10-242-504/+1
| | | | | | in the future, remove it. llvm-svn: 23952
* When a function takes a variable number of pointer arguments, with a zeroJeff Cohen2005-10-231-1/+2
| | | | | | | | | | | | | pointer marking the end of the list, the zero *must* be cast to the pointer type. An un-cast zero is a 32-bit int, and at least on x86_64, gcc will not extend the zero to 64 bits, thus allowing the upper 32 bits to be random junk. The new END_WITH_NULL macro may be used to annotate a such a function so that GCC (version 4 or newer) will detect the use of un-casted zero at compile time. llvm-svn: 23888
* add TargetExternalSymbolAndrew Lenharth2005-10-231-1/+13
| | | | llvm-svn: 23886
* BuildSDIV and BuildUDIV only work for i32/i64, but they don't check thatChris Lattner2005-10-221-10/+20
| | | | | | | | the input is that type, this caused a failure on gs on X86 last night. Move the hard checks into Build[US]Div since that is where decisions like this should be made. llvm-svn: 23881
* add a case missing from the dag combiner that exposed the failure onChris Lattner2005-10-211-0/+3
| | | | | | 2005-10-21-longlonggtu.ll. llvm-svn: 23875
* Make the coallescer a bit smarter, allowing it to join more live ranges.Chris Lattner2005-10-211-30/+85
| | | | | | | | | | | | For example, we can now join things like [0-30:0)[31-40:1)[52-59:2) with [40:60:0) if the 52-59 range is defined by a copy from the 40-60 range. The resultant range ends up being [0-30:0)[31-60:1). This fires a lot through-out the test suite (e.g. shrinking bc from 19492 -> 18509 machineinstrs) though most gains are smaller (e.g. about 50 copies eliminated from crafty). llvm-svn: 23866
* Fix LiveInterval::getOverlapingRanges to take things in the right orderChris Lattner2005-10-211-3/+3
| | | | | | | | | | (an unused method). Fix the merger so that it can merge ranges like this [10:12)[16:40) with [12:38) into [10:40) instead of bogus ranges. This sort of input will be possible for the merger coming shortly llvm-svn: 23865
* Fix a typo in the dag combiner, so that this can work on i64 targetsNate Begeman2005-10-211-3/+2
| | | | llvm-svn: 23856
* Invert the TargetLowering flag that controls divide by consant expansion.Nate Begeman2005-10-211-10/+37
| | | | | | | | | | Add a new flag to TargetLowering indicating if the target has really cheap signed division by powers of two, make ppc use it. This will probably go away in the future. Implement some more ISD::SDIV folds in the dag combiner Remove now dead code in the x86 backend. llvm-svn: 23853
* Fix a conditional so we don't access past the end of the range. Thanks toChris Lattner2005-10-201-6/+4
| | | | | | Andrew for bringing this to my attn. llvm-svn: 23850
* Fix a couple bugs in the const div stuff where we'd generate MULHS/MULHUNate Begeman2005-10-201-3/+4
| | | | | | | for types that aren't legal, and fail a divisor is less than zero comparison, which would cause us to drop a subtract. llvm-svn: 23846
* don't use llabs with apparently VC++ doesn't haveChris Lattner2005-10-201-1/+1
| | | | llvm-svn: 23845
* Fix order of eval problem from when I refactored this into a function.Chris Lattner2005-10-201-3/+2
| | | | llvm-svn: 23844
* add a new method, play around with some code.Chris Lattner2005-10-201-10/+56
| | | | | | | | Fix a *bug* in the extendIntervalEndTo method. In particular, if adding [2:10) to an interval containing [0:2),[10:30), we produced [0:10),[10,30). Which is not the most smart thing to do. Now produce [0:30). llvm-svn: 23841
* Refactor some code, pulling it out into a function. No functionality change.Chris Lattner2005-10-201-15/+26
| | | | llvm-svn: 23839
* Move the target constant divide optimization up into the dag combiner, soNate Begeman2005-10-201-0/+263
| | | | | | | that the nodes can be folded with other nodes, and we can not duplicate code in every backend. Alpha will probably want this too. llvm-svn: 23835
* Teach Legalize how to do something with EXTRACT_ELEMENT when the type ofNate Begeman2005-10-191-7/+30
| | | | | | the pair of elements is a legal type. llvm-svn: 23804
* Add the ability to lower return instructions to TargetLowering. ThisNate Begeman2005-10-181-2/+7
| | | | | | | allows us to lower legal return types to something else, to meet ABI requirements (such as that i64 be returned in two i32 regs on Darwin/ppc). llvm-svn: 23802
* Fix Generic/2005-10-18-ZeroSizeStackObject.ll by not requesting a zeroChris Lattner2005-10-181-0/+1
| | | | | | sized stack object if either the array size or the type size is zero. llvm-svn: 23801
* remove hackChris Lattner2005-10-181-3/+1
| | | | llvm-svn: 23797
* Fold (select C, load A, load B) -> load (select C, A, B). This happens quiteChris Lattner2005-10-181-7/+82
| | | | | | | | | | | | | | | | | | | | | | a lot throughout many programs. In particular, specfp triggers it a bunch for constant FP nodes when you have code like cond ? 1.0 : -1.0. If the PPC ISel exposed the loads implicit in pic references to external globals, we would be able to eliminate a load in cases like this as well: %X = external global int %Y = external global int int* %test4(bool %C) { %G = select bool %C, int* %X, int* %Y ret int* %G } Note that this breaks things that use SrcValue's (see the fixme), but since nothing uses them yet, this is ok. Also, simplify some code to use hasOneUse() on an SDOperand instead of hasNUsesOfValue directly. llvm-svn: 23781
* Implement some feedback from Chris re: constant canonicalizationNate Begeman2005-10-181-39/+27
| | | | llvm-svn: 23777
* Legalize BUILD_PAIR appropriately for upcoming 64 bit PowerPC work.Nate Begeman2005-10-181-0/+25
| | | | llvm-svn: 23776
* fold fmul X, +2.0 -> fadd X, X;Nate Begeman2005-10-171-14/+17
| | | | llvm-svn: 23774
OpenPOWER on IntegriCloud