summaryrefslogtreecommitdiff
path: root/lib/CodeGen
Commit message (Collapse)AuthorAge
...
* Fix order of eval problem from when I refactored this into a function.Chris Lattner2005-10-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23844 91177308-0d34-0410-b5e6-96231b3b80d8
* add a new method, play around with some code.Chris Lattner2005-10-20
| | | | | | | | | 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). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23841 91177308-0d34-0410-b5e6-96231b3b80d8
* Refactor some code, pulling it out into a function. No functionality change.Chris Lattner2005-10-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23839 91177308-0d34-0410-b5e6-96231b3b80d8
* Move the target constant divide optimization up into the dag combiner, soNate Begeman2005-10-20
| | | | | | | | that the nodes can be folded with other nodes, and we can not duplicate code in every backend. Alpha will probably want this too. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23835 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach Legalize how to do something with EXTRACT_ELEMENT when the type ofNate Begeman2005-10-19
| | | | | | | the pair of elements is a legal type. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23804 91177308-0d34-0410-b5e6-96231b3b80d8
* Add the ability to lower return instructions to TargetLowering. ThisNate Begeman2005-10-18
| | | | | | | | 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). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23802 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix Generic/2005-10-18-ZeroSizeStackObject.ll by not requesting a zeroChris Lattner2005-10-18
| | | | | | | sized stack object if either the array size or the type size is zero. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23801 91177308-0d34-0410-b5e6-96231b3b80d8
* remove hackChris Lattner2005-10-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23797 91177308-0d34-0410-b5e6-96231b3b80d8
* Fold (select C, load A, load B) -> load (select C, A, B). This happens quiteChris Lattner2005-10-18
| | | | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23781 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement some feedback from Chris re: constant canonicalizationNate Begeman2005-10-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23777 91177308-0d34-0410-b5e6-96231b3b80d8
* Legalize BUILD_PAIR appropriately for upcoming 64 bit PowerPC work.Nate Begeman2005-10-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23776 91177308-0d34-0410-b5e6-96231b3b80d8
* fold fmul X, +2.0 -> fadd X, X;Nate Begeman2005-10-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23774 91177308-0d34-0410-b5e6-96231b3b80d8
* add a trivial foldChris Lattner2005-10-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23764 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix this logic.Chris Lattner2005-10-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23756 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a case we were missing that was causing us to fail ↵Chris Lattner2005-10-15
| | | | | | CodeGen/PowerPC/rlwinm.ll:test3 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23755 91177308-0d34-0410-b5e6-96231b3b80d8
* Use getExtLoad here instead of getNode, as extloads produce two values. ThisChris Lattner2005-10-15
| | | | | | | fixes a legalize failure on SPASS for itanium. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23747 91177308-0d34-0410-b5e6-96231b3b80d8
* fold sext_in_reg, sext_in_reg where both have the same VT. This wasNate Begeman2005-10-14
| | | | | | | popping up in Fourinarow. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23722 91177308-0d34-0410-b5e6-96231b3b80d8
* Relax the checking on zextload generation a bit, since as sabre pointed outNate Begeman2005-10-14
| | | | | | | | | | | you could be AND'ing with the result of a shift that shifts out all the bits you care about, in addition to a constant. Also, move over an add/sub_parts fold from legalize to the dag combiner, where it works for things other than constants. Woot! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23720 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix the trunc(load) case, finally allowing crafty and povray to passChris Lattner2005-10-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23718 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix some bugs in (sext (load x))Chris Lattner2005-10-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23717 91177308-0d34-0410-b5e6-96231b3b80d8
* When ExpandOp'ing a [SZ]EXTLOAD, make sure to remember that the chainChris Lattner2005-10-13
| | | | | | | is also legal. Add support for ExpandOp'ing raw EXTLOADs too. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23716 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement PromoteOp for *EXTLOAD, allowing MallocBench/gs to LegalizeChris Lattner2005-10-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23715 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix the remaining DAGCombiner issues pointed out by sabre. This should fixNate Begeman2005-10-13
| | | | | | | the remainder of the failures introduced by my patch last night. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23714 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a minor bug in the dag combiner that broke pcompress2 and some otherChris Lattner2005-10-13
| | | | | | | tests. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23713 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support to Legalize for expanding i64 sextload/zextload into hi and loNate Begeman2005-10-13
| | | | | | | | parts. This should fix the crafty and signed long long unit test failure on x86 last night. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23711 91177308-0d34-0410-b5e6-96231b3b80d8
* Inhibit instructions from being pushed before function calls. This willJim Laskey2005-10-13
| | | | | | | minimize unnecessary spilling. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23710 91177308-0d34-0410-b5e6-96231b3b80d8
* Move some Legalize functionality over to the DAGCombiner where it belongs.Nate Begeman2005-10-13
| | | | | | | Kill some dead code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23706 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a potential bug with two combine-to's back to back that chris pointedNate Begeman2005-10-12
| | | | | | | | | | | out, where after the first CombineTo() call, the node the second CombineTo wishes to replace may no longer exist. Fix a very real bug with the truncated load optimization on little endian targets, which do not need a byte offset added to the load. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23704 91177308-0d34-0410-b5e6-96231b3b80d8
* More cool stuff for the dag combiner. We can now finally handle thingsNate Begeman2005-10-12
| | | | | | | | | | | | | | | | | | | | | | | | | like turning: _foo: fctiwz f0, f1 stfd f0, -8(r1) lwz r2, -4(r1) rlwinm r3, r2, 0, 16, 31 blr into _foo: fctiwz f0,f1 stfd f0,-8(r1) lhz r3,-2(r1) blr Also removed an unncessary constraint from sra -> srl conversion, which should take care of hte only reason we would ever need to handle sra in MaskedValueIsZero, AFAIK. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23703 91177308-0d34-0410-b5e6-96231b3b80d8
* Finally committing to the new scheduler. Still -sched=none by default.Jim Laskey2005-10-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23702 91177308-0d34-0410-b5e6-96231b3b80d8
* Added graphviz/gv support for MF.Jim Laskey2005-10-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23700 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a powerpc crash on CodeGen/Generic/llvm-ct-intrinsics.llChris Lattner2005-10-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23694 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a canonicalization that got lost, fixing PowerPC/fold-li.ll:SUBChris Lattner2005-10-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23693 91177308-0d34-0410-b5e6-96231b3b80d8
* clean up some corner casesChris Lattner2005-10-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23692 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement trivial DSE. If two stores are neighbors and store to the sameChris Lattner2005-10-10
| | | | | | | | location, replace them with a new store of the last value. This occurs in the same neighborhood in 197.parser, speeding it up about 1.5% git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23691 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for CombineTo, allowing the dag combiner to replace nodes withChris Lattner2005-10-10
| | | | | | | | | | | | | | | | | | | | | multiple results. Use this support to implement trivial store->load forwarding, implementing CodeGen/PowerPC/store-load-fwd.ll. Though this is the most simple case and can be extended in the future, it is still useful. For example, it speeds up 197.parser by 6.2% by avoiding an LSU reject in xalloc: stw r6, lo16(l5_end_of_array)(r2) addi r2, r5, -4 stwx r5, r4, r2 - lwzx r5, r4, r2 - rlwinm r5, r5, 0, 0, 30 stwx r5, r4, r2 lwz r2, -4(r4) ori r2, r2, 1 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23690 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach the DAGCombiner several new tricks, teaching it how to turnNate Begeman2005-10-10
| | | | | | | | sext_inreg into zext_inreg based on the signbit (fires a lot), srem into urem, etc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23688 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix commentChris Lattner2005-10-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23686 91177308-0d34-0410-b5e6-96231b3b80d8
* Add ISD::ADD to MaskedValueIsZeroChris Lattner2005-10-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23685 91177308-0d34-0410-b5e6-96231b3b80d8
* This function is now deadChris Lattner2005-10-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23684 91177308-0d34-0410-b5e6-96231b3b80d8
* Enable Nate's excellent DAG combiner work by default. This allows theChris Lattner2005-10-10
| | | | | | | removal of a bunch of ad-hoc and crufty code from SelectionDAG.cpp. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23682 91177308-0d34-0410-b5e6-96231b3b80d8
* add a todo for something I noticedChris Lattner2005-10-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23679 91177308-0d34-0410-b5e6-96231b3b80d8
* (X & Y) & C == 0 if either X&C or Y&C are zeroChris Lattner2005-10-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23678 91177308-0d34-0410-b5e6-96231b3b80d8
* When emiting a CopyFromReg and the source is already a vreg, do not botherChris Lattner2005-10-09
| | | | | | | | | | | | creating a new vreg and inserting a copy: just use the input vreg directly. This speeds up the compile (e.g. about 5% on mesa with a debug build of llc) by not adding a bunch of copies and vregs to be coallesced away. On mesa, for example, this reduces the number of intervals from 168601 to 129040 going into the coallescer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23671 91177308-0d34-0410-b5e6-96231b3b80d8
* Lo and behold, the last bits of SelectionDAG.cpp have been moved over.Nate Begeman2005-10-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23665 91177308-0d34-0410-b5e6-96231b3b80d8
* remove debugging codeChris Lattner2005-10-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23663 91177308-0d34-0410-b5e6-96231b3b80d8
* implement CodeGen/PowerPC/div-2.ll:test2-4 by propagating zero bits throughChris Lattner2005-10-07
| | | | | | | C-X's git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23662 91177308-0d34-0410-b5e6-96231b3b80d8
* fix indentationChris Lattner2005-10-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23660 91177308-0d34-0410-b5e6-96231b3b80d8
* Turn sdivs into udivs when we can prove the sign bits are clear. ThisChris Lattner2005-10-07
| | | | | | | implements CodeGen/PowerPC/div-2.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23659 91177308-0d34-0410-b5e6-96231b3b80d8
* silence a bogus GCC warningChris Lattner2005-10-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23646 91177308-0d34-0410-b5e6-96231b3b80d8