summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Change tblgen to emit FOOISD opcode names as twoChris Lattner2010-03-251-3/+9
| | | | | | | | | | | | | | bytes instead of one byte. This is important because we're running up to too many opcodes to fit in a byte and it is aggrevated by FIRST_TARGET_MEMORY_OPCODE making the numbering sparse. This just bites the bullet and bloats out the table. In practice, this increases the size of the x86 isel table from 74.5K to 76K. I think we'll cope :) This fixes rdar://7791648 llvm-svn: 99494
* Emit dwarf variable info communicated by code generator through DBG_VALUE ↵Devang Patel2010-03-151-2/+0
| | | | | | | | machine instructions. This is a work in progress. llvm-svn: 98556
* fix ShrinkDemandedOps to not leave dead nodes around,Chris Lattner2010-03-141-0/+6
| | | | | | fixing PR6607 llvm-svn: 98512
* rewrite ShrinkDemandedOps to be faster and indent less,Chris Lattner2010-03-141-48/+64
| | | | | | no functionality change. llvm-svn: 98511
* make -view-isel-dags print after the 'ShrinkDemandedOps' pass.Chris Lattner2010-03-141-2/+2
| | | | llvm-svn: 98509
* fix AsmPrinter::GetBlockAddressSymbol to always return a uniqueChris Lattner2010-03-141-0/+2
| | | | | | | label instead of trying to form one based on the BB name (which causes collisions if the name is empty). This fixes PR6608 llvm-svn: 98495
* change the LabelSDNode to be EHLabelSDNode and make it holdChris Lattner2010-03-141-12/+5
| | | | | | | | an MCSymbol. Make the EH_LABEL MachineInstr hold its label with an MCSymbol instead of ID. Fix a bug in MMI.cpp which would return labels named "Label4" instead of "label4". llvm-svn: 98463
* Attempt to make this debug output meaningful, both in the case ofDan Gohman2010-03-091-3/+6
| | | | | | multibyte opcodes and in the case of multiple scopes. llvm-svn: 98036
* Print the correct index in the "match failed at index" message.Dan Gohman2010-03-091-1/+1
| | | | llvm-svn: 98013
* Avoid creating bad PHI instructions when BR is being const-folded.Jakob Stoklund Olesen2010-03-051-0/+2
| | | | llvm-svn: 97836
* Fix PR6497, a bug where we'd fold a load into an addcChris Lattner2010-03-051-0/+7
| | | | | | | | | | | node which has a flag. That flag in turn was used by an already-selected adde which turned into an ADC32ri8 which used a selected load which was chained to the load we folded. This flag use caused us to form a cycle. Fix this by not ignoring chains in IsLegalToFold even in cases where the isel thinks it can. llvm-svn: 97791
* inline a small function with one call site.Chris Lattner2010-03-051-16/+4
| | | | llvm-svn: 97789
* add a statistic for # times fastisel fails.Chris Lattner2010-03-041-0/+6
| | | | llvm-svn: 97738
* change the new isel matcher to emit ComplexPattern matchesChris Lattner2010-03-041-3/+7
| | | | | | | | | | as the very last thing before node emission. This should dramatically reduce the number of times we do 'MatchAddress' on X86, speeding up compile time. This also improves comments in the tables and shrinks the table a bit, now down to 80506 bytes for x86. llvm-svn: 97703
* inline CannotYetSelectIntrinsic into CannotYetSelect and simplify.Chris Lattner2010-03-041-19/+16
| | | | llvm-svn: 97690
* add some of the more obscure predicate types to the Chris Lattner2010-03-031-56/+99
| | | | | | Scope accelerator. llvm-svn: 97652
* speed up scope node processing: if the first element of a scopeChris Lattner2010-03-031-38/+141
| | | | | | | | | | | | | entry we're about to process is obviously going to fail, don't bother pushing a scope only to have it immediately be popped. This avoids a lot of scope stack traffic in common cases. Unfortunately, this requires duplicating some of the predicate dispatch. To avoid duplicating the actual logic I pulled each predicate out to its own static function which gets used in both places. llvm-svn: 97651
* introduce a new SwitchTypeMatcher node (which is analogous toChris Lattner2010-03-031-3/+34
| | | | | | | | SwitchOpcodeMatcher) and have DAGISelMatcherOpt form it. This speeds up selection, particularly for X86 which has lots of variants of instructions with only type differences. llvm-svn: 97645
* Fix some issues in WalkChainUsers dealing with Chris Lattner2010-03-021-11/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | CopyToReg/CopyFromReg/INLINEASM. These are annoying because they have the same opcode before an after isel. Fix this by setting their NodeID to -1 to indicate that they are selected, just like what automatically happens when selecting things that end up being machine nodes. With that done, give IsLegalToFold a new flag that causes it to ignore chains. This lets the HandleMergeInputChains routine be the one place that validates chains after a match is successful, enabling the new hotness in chain processing. This smarter chain processing eliminates the need for "PreprocessRMW" in the X86 and MSP430 backends and enables MSP to start matching it's multiple mem operand instructions more aggressively. I currently #if out the dead code in the X86 backend and MSP backend, I'll remove it for real in a follow-on patch. The testcase changes are: test/CodeGen/X86/sse3.ll: we generate better code test/CodeGen/X86/store_op_load_fold2.ll: PreprocessRMW was miscompiling this before, we now generate correct code Convert it to filecheck while I'm at it. test/CodeGen/MSP430/Inst16mm.ll: Add a testcase for mem/mem folding to make anton happy. :) llvm-svn: 97596
* run HandleMergeInputChains even if we only have one input chain.Chris Lattner2010-03-021-29/+3
| | | | llvm-svn: 97581
* Fix the xfail I added a couple of patches back. The issueChris Lattner2010-03-021-12/+40
| | | | | | | | | was that we weren't properly handling the case when interior nodes of a matched pattern become dead after updating chain and flag uses. Now we handle this explicitly in UpdateChainsAndFlags. llvm-svn: 97561
* I was confused about this, it turns out that MorphNodeToChris Lattner2010-03-021-3/+2
| | | | | | *does* delete ex-operands that become dead. llvm-svn: 97559
* factor node morphing out to its own helper method.Chris Lattner2010-03-021-54/+62
| | | | llvm-svn: 97558
* Sink InstructionSelect() out of each target into SDISel, and rename itChris Lattner2010-03-021-2/+59
| | | | | | | | | | | | DoInstructionSelection. Inline "SelectRoot" into it from DAGISelHeader. Sink some other stuff out of DAGISelHeader into SDISel. Eliminate the various 'Indent' stuff from various targets, which dates to when isel was recursive. 17 files changed, 114 insertions(+), 430 deletions(-) llvm-svn: 97555
* Use the right induction variable.Chris Lattner2010-03-021-2/+2
| | | | llvm-svn: 97541
* Rewrite chain handling validation and input TokenFactor handlingChris Lattner2010-03-021-54/+158
| | | | | | | | | | | | | | | | | | | | | | | | | | | stuff now that we don't care about emulating the old broken behavior of the old isel. This eliminates the 'CheckChainCompatible' check (along with IsChainCompatible) which did an incorrect and inefficient scan *up* the chain nodes which happened as the pattern was being formed and does the validation at the end in HandleMergeInputChains when it forms a structural pattern. This scans "down" the graph, which means that it is quickly bounded by nodes already selected. This also handles token factors that get "trapped" in the dag. Removing the CheckChainCompatible nodes also shrinks the generated tables by about 6K for X86 (down to 83K). There are two pieces remaining before I can nuke PreprocessRMW: 1. I xfailed a test because we're now producing worse code in a case that has nothing to do with the change: it turns out that our use of MorphNodeTo will leave dead nodes in the graph which (depending on how the graph is walked) end up causing bogus uses of chains and blocking matches. This is really bad for other reasons, so I'll fix this in a follow-up patch. 2. CheckFoldableChainNode needs to be improved to handle the TF. llvm-svn: 97539
* remove dead code.Chris Lattner2010-03-021-31/+0
| | | | llvm-svn: 97529
* refactor some code out of OPC_EmitMergeInputChains into aChris Lattner2010-03-021-21/+37
| | | | | | new helper function. llvm-svn: 97525
* Accelerate isel dispatch for tables that start with a top-level Chris Lattner2010-03-011-1/+36
| | | | | | | OPC_SwitchOpcode to use a table lookup instead of having to go through the interpreter for this. llvm-svn: 97469
* some trivial microoptimizations.Chris Lattner2010-03-011-3/+10
| | | | llvm-svn: 97441
* eliminate the CheckMultiOpcodeMatcher code and have each Chris Lattner2010-03-011-9/+0
| | | | | | | | | ComplexPattern at the root be generated multiple times, once for each opcode they are part of. This encourages factoring because the opcode checks get treated just like everything else in the matcher. llvm-svn: 97439
* add a new OPC_SwitchOpcode which is semantically equivalentChris Lattner2010-03-011-0/+30
| | | | | | | | | | | | to a scope where every child starts with a CheckOpcode, but executes more efficiently. Enhance DAGISelMatcherOpt to form it. This also fixes a bug in CheckOpcode: apparently the SDNodeInfo objects are not pointer comparable, we have to compare the enum name. llvm-svn: 97438
* eliminate GetInt1/2Chris Lattner2010-02-281-16/+3
| | | | llvm-svn: 97426
* hoist the new isel interpreter out of DAGISelHeader.hChris Lattner2010-02-281-0/+859
| | | | | | | | (which gets #included into the middle of each target's DAGISel class) into a .cpp file where it is only compiled once. llvm-svn: 97425
* fix a bug in findNonImmUse (used by IsLegalToFold) where nodes withChris Lattner2010-02-231-2/+14
| | | | | | | | | | no id's would cause early exit allowing IsLegalToFold to return true instead of false, producing a cyclic dag. This was striking the new isel because it isn't using SelectNodeTo yet, which theoretically is just an optimization. llvm-svn: 96972
* sink special case "cannotyetselect" for intrinsics out of the Chris Lattner2010-02-171-0/+5
| | | | | | tblgen splatted code into the implementation. llvm-svn: 96460
* Split SelectionDAGISel::IsLegalAndProfitableToFold toEvan Cheng2010-02-151-8/+13
| | | | | | | | IsLegalToFold and IsProfitableToFold. The generic version of the later simply checks whether the folding candidate has a single use. This allows the target isel routines more flexibility in deciding whether folding makes sense. The specific case we are interested in is folding constant pool loads with multiple uses. llvm-svn: 96255
* Now that ShrinkDemandedOps() is separated out from DAG combine. It sometimes ↵Evan Cheng2010-02-101-1/+18
| | | | | | leave some obvious nops which dag combine used to clean up afterwards e.g. (trunk (ext n)) -> n. Look for them and squash them. llvm-svn: 95757
* move target-independent opcodes out of TargetInstrInfoChris Lattner2010-02-091-9/+8
| | | | | | | | | into TargetOpcodes.h. #include the new TargetOpcodes.h into MachineInstr. Add new inline accessors (like isPHI()) to MachineInstr, and start using them throughout the codebase. llvm-svn: 95687
* Remove the '-disable-scheduling' flag and replace it with the 'source' option ofBill Wendling2010-01-231-1/+1
| | | | | | | | | the '-pre-RA-sched' flag. It actually makes more sense to do it this way. Also, keep track of the SDNode ordering by default. Eventually, we would like to make this ordering a way to break a "tie" in the scheduler. However, doing that now breaks the "CodeGen/X86/abi-isel.ll" test for 32-bit Linux. llvm-svn: 94308
* Add some new debugging APIs to print out "raw" SelectionDAGs to makeDavid Greene2010-01-191-1/+1
| | | | | | understanding CannotYTetSelect and other errors easier. llvm-svn: 93901
* Add some debug routines to SelectionDAG to dump full DAGs.David Greene2010-01-151-1/+1
| | | | | | | | | | | print/dumpWithDepth allows one to dump a DAG up to N levels deep. dump/printWithFullDepth prints the whole DAG, subject to a depth limit on 100 in the default case (to prevent infinite recursion). Have CannotYetSelect to a dumpWithFullDepth so it is clearer exactly what the non-matching DAG looks like. llvm-svn: 93538
* fix 80-column violationsJim Grosbach2010-01-151-12/+14
| | | | llvm-svn: 93487
* Update a partially obsolete comment.Dan Gohman2010-01-121-1/+1
| | | | llvm-svn: 93228
* Avoid adding PHI arguments for a predecessor that has gone away when a ↵Jakob Stoklund Olesen2010-01-111-14/+19
| | | | | | | | BRCOND was constant folded. This fixes PR5980. llvm-svn: 93184
* Dan pointed out checking whether a node is dead by comparing its opcode to ↵Evan Cheng2010-01-091-8/+26
| | | | | | ISD::DELETED_NODE is not safe. Use a DAGUpdateListener to remove dead nodes from work list instead. llvm-svn: 93031
* ReplaceAllUsesOfValueWith may delete other nodes that the one being ↵Evan Cheng2010-01-081-1/+2
| | | | | | replaced. Do not delete dead nodes again. llvm-svn: 92988
* Use pop_back_val instead of back()+pop_back.Benjamin Kramer2010-01-071-7/+4
| | | | llvm-svn: 92918
* Comment.Evan Cheng2010-01-061-0/+3
| | | | llvm-svn: 92850
* Teach dag combine to fold the following transformation more aggressively:Evan Cheng2010-01-061-1/+72
| | | | | | | | | | (OP (trunc x), (trunc y)) -> (trunc (OP x, y)) Unfortunately this simple change causes dag combine to infinite looping. The problem is the shrink demanded ops optimization tend to canonicalize expressions in the opposite manner. That is badness. This patch disable those optimizations in dag combine but instead it is done as a late pass in sdisel. This also exposes some deficiencies in dag combine and x86 setcc / brcond lowering. Teach them to look pass ISD::TRUNCATE in various places. llvm-svn: 92849
OpenPOWER on IntegriCloud