summaryrefslogtreecommitdiff
path: root/utils/TableGen/DAGISelEmitter.cpp
Commit message (Collapse)AuthorAge
* Can't trust NodeDepth when checking for possibility of load folding creatingEvan Cheng2006-05-25
| | | | | | | | | a cycle. This increase the search space and will increase compile time (in practice it appears to be small, e.g. 176.gcc goes from 62 sec to 65 sec) that will be addressed later. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28476 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed a really ugly bug. The TableGen'd isel is not freeing the "inflight set"Evan Cheng2006-05-25
| | | | | | | | correctly. That is causing non-deterministic behavior (and possibly preventing some load folding from happening). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28458 91177308-0d34-0410-b5e6-96231b3b80d8
* Now that iPTR is a fully resolved type. We end up losing the type check forEvan Cheng2006-05-19
| | | | | | | | | | | | patterns that look like this: def : Pat<(i32 (X86Wrapper tconstpool :$dst)), (MOV32ri tconstpool :$dst)>; InsertOneTypeCheck should copy the type from the resolved pattern to the unresolved one as long as there types are different. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28389 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove PointerType from target definition. Use abstract type MVT::iPTR toEvan Cheng2006-05-17
| | | | | | | represent pointer type. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28363 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow patterns to refer to physical registers that belong to multipleEvan Cheng2006-05-16
| | | | | | | register classes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28323 91177308-0d34-0410-b5e6-96231b3b80d8
* Unused instructionEvan Cheng2006-05-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28240 91177308-0d34-0410-b5e6-96231b3b80d8
* Watch out for the following case:Evan Cheng2006-05-10
| | | | | | | | | 1. Use expects a chain output. 2. Node is expanded into multiple target ops. 3. One of the inner node produces a chain, the outer most one doesn't. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28209 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a load folding bug. It is exposed by a multi- resulting instructionsEvan Cheng2006-05-10
| | | | | | | def : Pat<> pattern. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28208 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the temporary option: -no-isel-fold-inflightEvan Cheng2006-04-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28012 91177308-0d34-0410-b5e6-96231b3b80d8
* When isel'ing a node, mark its operands "InFlight" before selecting them. TheseEvan Cheng2006-04-28
| | | | | | | | | nodes should not be folded into other nodes. This fixes the miscompilation of PR 749. Temporarily under flag control. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28002 91177308-0d34-0410-b5e6-96231b3b80d8
* JumpTable support! What this represents is working asm and jit support forNate Begeman2006-04-22
| | | | | | | | | x86 and ppc for 100% dense switch statements when relocations are non-PIC. This support will be extended and enhanced in the coming days to support PIC, and less dense forms of jump tables. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27947 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename AddedCost to AddedComplexity.Evan Cheng2006-04-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27841 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow "let AddedCost = n in" to increase pattern complexity.Evan Cheng2006-04-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27834 91177308-0d34-0410-b5e6-96231b3b80d8
* Infer element types for shuffle masksChris Lattner2006-04-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27456 91177308-0d34-0410-b5e6-96231b3b80d8
* rename a method, to avoid confusion with llvm intrinsics.Chris Lattner2006-04-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27455 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow bits init values to be used in patterns, turn them into ints.Chris Lattner2006-03-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27286 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement Regression/TableGen/DagDefSubst.llChris Lattner2006-03-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27263 91177308-0d34-0410-b5e6-96231b3b80d8
* Tblgen doesn't like multiple SDNode<> definitions that map to the sameenum ↵Chris Lattner2006-03-28
| | | | | | | | | value. Split them into separate enums. Also, don't emit dynamic checks when we can compute them statically git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27202 91177308-0d34-0410-b5e6-96231b3b80d8
* Print error messages like this:Chris Lattner2006-03-27
| | | | | | | | | | tblgen: In STVEBX: Intrinsic 'llvm.ppc.altivec.stvebx' expects 3 operands, not 2 operands! instead of like this: tblgen: In STVEBX: Intrinsic 'intrinsic_void expects 3 operands, not 2 operands! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27185 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a missing check which cause an invalid .td file to crash tblgenChris Lattner2006-03-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27126 91177308-0d34-0410-b5e6-96231b3b80d8
* When failing selection for an intrinsic, print this:Chris Lattner2006-03-25
| | | | | | | | | | | Cannot yet select: intrinsic %llvm.ppc.altivec.lvx instead of this: Cannot yet select: 0x9b047e0: v4i32,ch = INTRINSIC 0x9b04540:1, 0x9b04710, 0x9b04790, 0x9b04540 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27110 91177308-0d34-0410-b5e6-96231b3b80d8
* Change approach so that we get codegen for free for intrinsics. With this,Chris Lattner2006-03-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | intrinsics that don't take pointer arguments now work. For example, we can compile this: int test3( __m128d *A) { return _mm_movemask_pd(*A); } int test4( __m128 *A) { return _mm_movemask_ps(*A); } to this: _test3: movl 4(%esp), %eax movapd (%eax), %xmm0 movmskpd %xmm0, %eax ret _test4: movl 4(%esp), %eax movaps (%eax), %xmm0 movmskps %xmm0, %eax ret git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27090 91177308-0d34-0410-b5e6-96231b3b80d8
* fix 80 column violationsChris Lattner2006-03-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27084 91177308-0d34-0410-b5e6-96231b3b80d8
* Parse intrinsics correctly and perform type propagation. This doesn't currentlyChris Lattner2006-03-24
| | | | | | | emit the code to select intrinsics, but that is next :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27082 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow result node to be a simple leaf node. This enable bitconvert patternsEvan Cheng2006-03-23
| | | | | | | | like this: def : Pat<(v4i32 (bitconvert (v4f32 VR128:$src))), (v4i32 VR128:$src)>; git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26968 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't forget to promote xform function to an explicit node for def : Pat<>Evan Cheng2006-03-21
| | | | | | | patterns. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26929 91177308-0d34-0410-b5e6-96231b3b80d8
* minor code simplificationChris Lattner2006-03-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26918 91177308-0d34-0410-b5e6-96231b3b80d8
* The node wrapped in PatLeaf<> should be treated as a leaf even if it isn'tEvan Cheng2006-03-20
| | | | | | | one, i.e. don't select it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26909 91177308-0d34-0410-b5e6-96231b3b80d8
* It should be ok for a xform output type to be different from input type.Evan Cheng2006-03-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26899 91177308-0d34-0410-b5e6-96231b3b80d8
* Copy matching pattern's output type info to instruction result pattern.Evan Cheng2006-03-20
| | | | | | | | The instruction patterns do not contain enough information to resolve the exact type of the destination if it of a generic vector type. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26892 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a new SDTCisIntVectorOfSameSize type constraintChris Lattner2006-03-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26890 91177308-0d34-0410-b5e6-96231b3b80d8
* Temporary hack to enable more (store (op (load ...))) folding. This makesEvan Cheng2006-03-09
| | | | | | | | it possible when a TokenFactor is between the load and store. But is still missing some cases due to ordering issue. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26638 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't generate silly matching code like this:Evan Cheng2006-03-07
| | | | | | | | | | | | | if (N1.getOpcode() == ISD::ADD && ...) if (... && (N1.getNumOperands() == 1 || !isNonImmUse(N1.Val, N10.Val))) && ...) TableGen knows N1 must have more than one operand. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26592 91177308-0d34-0410-b5e6-96231b3b80d8
* Select inline asm memory operands.Chris Lattner2006-02-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26349 91177308-0d34-0410-b5e6-96231b3b80d8
* Bump up pattern cost if the resulting instruction is markedEvan Cheng2006-02-18
| | | | | | | usesCustomDAGSchedInserter. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26282 91177308-0d34-0410-b5e6-96231b3b80d8
* Call InsertISelMapEntry rather than map insertion operator to prevent overlyEvan Cheng2006-02-09
| | | | | | | aggrssive inlining. This reduces Select_store frame size from 24k to 10k. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26095 91177308-0d34-0410-b5e6-96231b3b80d8
* Match getTargetNode() changes (now returns SDNode* instead of SDOperand).Evan Cheng2006-02-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26084 91177308-0d34-0410-b5e6-96231b3b80d8
* Change Select() fromEvan Cheng2006-02-09
| | | | | | | | | SDOperand Select(SDOperand N); to void Select(SDOperand &Result, SDOperand N); git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26067 91177308-0d34-0410-b5e6-96231b3b80d8
* Hoist all SDOperand declarations within a Select_{opcode}() to the top levelEvan Cheng2006-02-07
| | | | | | | to reduce stack memory usage. This is intended to work around the gcc bug. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26026 91177308-0d34-0410-b5e6-96231b3b80d8
* At the end of isel, select a replacement node for each handle that does notEvan Cheng2006-02-06
| | | | | | | | have one. This can happen if a load's real uses are dead (i.e. they do not have uses themselves). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26014 91177308-0d34-0410-b5e6-96231b3b80d8
* Name change.Evan Cheng2006-02-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26013 91177308-0d34-0410-b5e6-96231b3b80d8
* Handle HANDLENODE: just return itself.Evan Cheng2006-02-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26011 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow more loads to be folded which were previously prevented from happeningEvan Cheng2006-02-05
| | | | | | | | | | | | | | | | | due to ordering issue. i.e. they were selected for chain use first. Now at load select time, check if it is being selected for a chain use and if it has only a single real use. If so, return a HANDLENODE (with the load as its operand) in its place and record it. When it is folded or the load is selected for a real use, the isel records it as the replacement for the HANDLENODE. The replacement is done when all nodes are selected. This scheme exposed a couple of problems where cycles can happen. (See comments in EmitMatchCode() for descriptions of the problems and their workaround / solutions.) These problems have been resolved with a small compile time penality. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25995 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-committing the last bit of change. It shouldn't break PPC this time.Evan Cheng2006-02-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25982 91177308-0d34-0410-b5e6-96231b3b80d8
* Temporarily revert the last change, which breaks PPC and other targets thatChris Lattner2006-02-04
| | | | | | | DO select things. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25970 91177308-0d34-0410-b5e6-96231b3b80d8
* Complex pattern's custom matcher should not call Select() on any operands.Evan Cheng2006-02-04
| | | | | | | Select them afterwards if it returns true. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25968 91177308-0d34-0410-b5e6-96231b3b80d8
* node predicates add to the complexity of a pattern. This ensures that theChris Lattner2006-02-03
| | | | | | | | X86 backend attempts to match small-immediate versions of instructions before the full size immediate versions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25937 91177308-0d34-0410-b5e6-96231b3b80d8
* (store (op (load ...))) folding problem. In the generated matching code,Evan Cheng2006-02-03
| | | | | | | | | | | | | | | | Chain is initially set to the chain operand of store node, when it reaches load, if it matches the load then Chain is set to the chain operand of the load. However, if the matching code that follows this fails, isel moves on to the next pattern but it does not restore Chain to the chain operand of the store. So when it tries to match the next store / op / load pattern it would fail on the Chain == load.getOperand(0) test. The solution is for each chain operand to get a unique name. e.g. Chain10. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25931 91177308-0d34-0410-b5e6-96231b3b80d8
* If a pattern's root node is a constant, its size should be 3 rather than 2.Evan Cheng2006-02-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25870 91177308-0d34-0410-b5e6-96231b3b80d8
* simplify some codeChris Lattner2006-01-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25791 91177308-0d34-0410-b5e6-96231b3b80d8