aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/CodeGen/DAGISelHeader.h
Commit message (Collapse)AuthorAgeFilesLines
* Generalize one of the SelectionDAG::ReplaceAllUsesWith overloadsDan Gohman2009-04-151-8/+1
| | | | | | | | | to support replacing a node with another that has a superset of the result types. Use this instead of calling ReplaceAllUsesOfValueWith for each value. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69209 91177308-0d34-0410-b5e6-96231b3b80d8
* Delete unnecessary elses.Dan Gohman2009-01-281-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63214 91177308-0d34-0410-b5e6-96231b3b80d8
* Make ISel ignore dead nodes. The DAGCombiner normally eliminatesDan Gohman2008-11-051-0/+5
| | | | | | | | dead nodes, but in this case its missing one. Fixing the DAGCombiner is desirable, but it's somewhat involved. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58777 91177308-0d34-0410-b5e6-96231b3b80d8
* The HadDelete field is no longer used.Dan Gohman2008-11-051-1/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58761 91177308-0d34-0410-b5e6-96231b3b80d8
* Update some comments to reflect the new code.Dan Gohman2008-11-051-3/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58759 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate the ISel priority queue, which used the topological order for aDan Gohman2008-11-051-113/+32
| | | | | | | | | | | | | | | | | | | | | | | | | priority function. Instead, just iterate over the AllNodes list, which is already in topological order. This eliminates a fair amount of bookkeeping, and speeds up the isel phase by about 15% on many testcases. The impact on most targets is that AddToISelQueue calls can be simply removed. In the x86 target, there are two additional notable changes. The rule-bending AND+SHIFT optimization in MatchAddress that creates new pre-isel nodes during isel is now a little more verbose, but more robust. Instead of either creating an invalid DAG or creating an invalid topological sort, as it has historically done, it can now just insert the new nodes into the node list at a position where they will be consistent with the topological ordering. Also, the address-matching code has logic that checked to see if a node was "already selected". However, when a node is selected, it has all its uses taken away via ReplaceAllUsesWith or equivalent, so it won't recieve any further visits from MatchAddress. This code is now removed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58748 91177308-0d34-0410-b5e6-96231b3b80d8
* Totally disable the setSubgraphColor calls temporarily, as they'reDan Gohman2008-10-311-2/+2
| | | | | | | currently troublesome even for #ifndef NDEBUG builds. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58512 91177308-0d34-0410-b5e6-96231b3b80d8
* Add some more information to the top-level comment for this file.Dan Gohman2008-10-281-1/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58339 91177308-0d34-0410-b5e6-96231b3b80d8
* Avoid calls to setSubgraphColor in release mode. They generate lots of error ↵Evan Cheng2008-10-281-1/+4
| | | | | | messages and slow down compilation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58336 91177308-0d34-0410-b5e6-96231b3b80d8
* Have TableGen emit setSubgraphColor calls under control of a -gen-debugDavid Greene2008-10-271-2/+7
| | | | | | | | | flag. Then in a debugger developers can set breakpoints at these calls to see waht is about to be selected and what the resulting subgraph looks like. This really helps when debugging instruction selection. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58278 91177308-0d34-0410-b5e6-96231b3b80d8
* Optimize SelectionDAG's AssignTopologicalOrder even further.Dan Gohman2008-09-301-4/+4
| | | | | | | | | | | | | | | | | | | | Completely eliminate the TopOrder std::vector. Instead, sort the AllNodes list in place. This also eliminates the need to call AllNodes.size(), a linear-time operation, before performing the sort. Also, eliminate the Sources temporary std::vector, since it essentially duplicates the sorted result as it is being built. This also changes the direction of the topological sort from bottom-up to top-down. The AllNodes list starts out in roughly top-down order, so this reduces the amount of reordering needed. Top-down is also more convenient for Legalize, and ISel needed only minor adjustments. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56867 91177308-0d34-0410-b5e6-96231b3b80d8
* erect abstraction boundaries for accessing SDValue members, rename Val -> ↵Gabor Greif2008-08-281-6/+6
| | | | | | Node to reflect semantics git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55504 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify SelectRoot's interface, and factor out some common codeDan Gohman2008-08-211-2/+2
| | | | | | | from all targets. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55124 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename SDOperand to SDValue.Dan Gohman2008-07-271-7/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54128 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a new function, ReplaceAllUsesOfValuesWith, which handles bulkDan Gohman2008-07-171-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | replacement of multiple values. This is slightly more efficient than doing multiple ReplaceAllUsesOfValueWith calls, and theoretically could be optimized even further. However, an important property of this new function is that it handles the case where the source value set and destination value set overlap. This makes it feasible for isel to use SelectNodeTo in many very common cases, which is advantageous because SelectNodeTo avoids a temporary node and it doesn't require CSEMap updates for users of values that don't change position. Revamp MorphNodeTo, which is what does all the work of SelectNodeTo, to handle operand lists more efficiently, and to correctly handle a number of corner cases to which its new wider use exposes it. This commit also includes a change to the encoding of post-isel opcodes in SDNodes; now instead of being sandwiched between the target-independent pre-isel opcodes and the target-dependent pre-isel opcodes, post-isel opcodes are now represented as negative values. This makes it possible to test if an opcode is pre-isel or post-isel without having to know the size of the current target's post-isel instruction set. These changes speed up llc overall by 3% and reduce memory usage by 10% on the InstructionCombining.cpp testcase with -fast and -regalloc=local. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53728 91177308-0d34-0410-b5e6-96231b3b80d8
* Indentation.Evan Cheng2008-07-171-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53727 91177308-0d34-0410-b5e6-96231b3b80d8
* Sometimes (rarely) nodes held in LegalizeTypesDuncan Sands2008-06-111-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | maps can be deleted. This happens when RAUW replaces a node N with another equivalent node E, deleting the first node. Solve this by adding (N, E) to ReplacedNodes, which is already used to remap nodes to replacements. This means that deleted nodes are being allowed in maps, which can be delicate: the memory may be reused for a new node which might get confused with the old deleted node pointer hanging around in the maps, so detect this and flush out maps if it occurs (ExpungeNode). The expunging operation is expensive, however it never occurs during a llvm-gcc bootstrap or anywhere in the nightly testsuite. It occurs three times in "make check": Alpha/illegal-element-type.ll, PowerPC/illegal-element-type.ll and X86/mmx-shift.ll. If expunging proves to be too expensive then there are other more complicated ways of solving the problem. In the normal case this patch adds the overhead of a few more map lookups, which is hopefully negligable. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52214 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not generate by TableGen the hard-coded standard, target-independent part ofRoman Levenstein2008-05-141-0/+192
DAG instruction selectors. Introudce a dedicated header file for this part: include/llvm/CodeGen/DAGISelHeader.h TableGen now only generates the include preprocessor directive to include this new header. This is a preparation for supporting multiple implementations of instruction selectors in the future. Reviewed and approved by Evan and Dan. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51102 91177308-0d34-0410-b5e6-96231b3b80d8