summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Now that BUILD_VECTOR operands are allowed to beDuncan Sands2009-04-191-9/+6
| | | | | | | | bigger than the vector element type, turn checking of the operand type back on again, appropriately adjusted. llvm-svn: 69516
* Don't try to make BUILD_VECTOR operands have the sameDuncan Sands2009-04-181-1/+4
| | | | | | | | | | | | | | | | | type as the vector element type: allow them to be of a wider integer type than the element type all the way through the system, and not just as far as LegalizeDAG. This should be safe because it used to be this way (the old type legalizer would produce such nodes), so backends should be able to handle it. In fact only targets which have legal vector types with an illegal promoted element type will ever see this (eg: <4 x i16> on ppc). This fixes a regression with the new type legalizer (vec_splat.ll). Also, treat SCALAR_TO_VECTOR the same as BUILD_VECTOR. After all, it is just a special case of BUILD_VECTOR. llvm-svn: 69467
* Generalize one of the SelectionDAG::ReplaceAllUsesWith overloadsDan Gohman2009-04-151-5/+8
| | | | | | | | to support replacing a node with another that has a superset of the result types. Use this instead of calling ReplaceAllUsesOfValueWith for each value. llvm-svn: 69209
* Change SelectionDAG type legalization to allow BUILD_VECTOR operands to beBob Wilson2009-04-131-4/+15
| | | | | | | | | | | | | | | | | | | | | | | | promoted to legal types without changing the type of the vector. This is following a suggestion from Duncan (http://lists.cs.uiuc.edu/pipermail/llvmdev/2009-February/019923.html). The transformation that used to be done during type legalization is now postponed to DAG legalization. This allows the BUILD_VECTORs to be optimized and potentially handled specially by target-specific code. It turns out that this is also consistent with an optimization done by the DAG combiner: a BUILD_VECTOR and INSERT_VECTOR_ELT may be combined by replacing one of the BUILD_VECTOR operands with the newly inserted element; but INSERT_VECTOR_ELT allows its scalar operand to be larger than the element type, with any extra high bits being implicitly truncated. The result is a BUILD_VECTOR where one of the operands has a type larger the the vector element type. Any code that operates on BUILD_VECTORs may now need to be aware of the potential type discrepancy between the vector element type and the BUILD_VECTOR operands. This patch updates all of the places that I could find to handle that case. llvm-svn: 68996
* Remove the obsolete SelectionDAG::getNodeValueTypes and simplifyDan Gohman2009-04-091-28/+21
| | | | | | code that uses it by using SelectionDAG::getVTList instead. llvm-svn: 68744
* Delete ISD::INSERT_SUBREG and ISD::EXTRACT_SUBREG, which are unused.Dan Gohman2009-04-031-3/+0
| | | | | | | Note that these are distinct from TargetInstrInfo::INSERT_SUBREG and TargetInstrInfo::EXTRACT_SUBREG, which are used. llvm-svn: 68355
* Now that errs() is properly non-buffered, there's no need toDan Gohman2009-03-231-2/+0
| | | | | | explicitly flush it. llvm-svn: 67526
* Fix some significant problems with constant pools that resulted in ↵Evan Cheng2009-03-131-4/+2
| | | | | | | | | | | | | | | | | | | | | | | unnecessary paddings between constant pool entries, larger than necessary alignments (e.g. 8 byte alignment for .literal4 sections), and potentially other issues. 1. ConstantPoolSDNode alignment field is log2 value of the alignment requirement. This is not consistent with other SDNode variants. 2. MachineConstantPool alignment field is also a log2 value. 3. However, some places are creating ConstantPoolSDNode with alignment value rather than log2 values. This creates entries with artificially large alignments, e.g. 256 for SSE vector values. 4. Constant pool entry offsets are computed when they are created. However, asm printer group them by sections. That means the offsets are no longer valid. However, asm printer uses them to determine size of padding between entries. 5. Asm printer uses expensive data structure multimap to track constant pool entries by sections. 6. Asm printer iterate over SmallPtrSet when it's emitting constant pool entries. This is non-deterministic. Solutions: 1. ConstantPoolSDNode alignment field is changed to keep non-log2 value. 2. MachineConstantPool alignment field is also changed to keep non-log2 value. 3. Functions that create ConstantPool nodes are passing in non-log2 alignments. 4. MachineConstantPoolEntry no longer keeps an offset field. It's replaced with an alignment field. Offsets are not computed when constant pool entries are created. They are computed on the fly in asm printer and JIT. 5. Asm printer uses cheaper data structure to group constant pool entries. 6. Asm printer compute entry offsets after grouping is done. 7. Change JIT code to compute entry offsets on the fly. llvm-svn: 66875
* Oops...I committed too much.Bill Wendling2009-03-131-5/+2
| | | | llvm-svn: 66867
* Temporarily XFAIL this test.Bill Wendling2009-03-131-2/+5
| | | | llvm-svn: 66866
* Fix BuildVectorSDNode::isConstantSplat to handle one-element vectors.Bob Wilson2009-03-041-2/+2
| | | | | | | It is an error to call APInt::zext with a size that is equal to the value's current size, so use zextOrTrunc instead. llvm-svn: 66039
* Generalize BuildVectorSDNode::isConstantSplat to use APInts and handleBob Wilson2009-03-021-78/+49
| | | | | | | | arbitrary vector sizes. Add an optional MinSplatBits parameter to specify a minimum for the splat element size. Update the PPC target to use the revised interface. llvm-svn: 65899
* Combine PPC's GetConstantBuildVectorBits and isConstantSplat functions to a newBob Wilson2009-03-011-0/+91
| | | | | | method in a BuildVectorSDNode "pseudo-class". llvm-svn: 65747
* Revert BuildVectorSDNode related patches: 65426, 65427, and 65296.Evan Cheng2009-02-251-144/+12
| | | | llvm-svn: 65482
* Expand tabs to spaces (overlooked in previous commit)Scott Michel2009-02-251-12/+12
| | | | llvm-svn: 65427
* Remove all "cached" data from BuildVectorSDNode, preferring to retrieveScott Michel2009-02-251-13/+8
| | | | | | | | | results via reference parameters. This patch also appears to fix Evan's reported problem supplied as a reduced bugpoint test case. llvm-svn: 65426
* Fix a ValueTracking rule: RHS means operand 1, not 0. Add a simpleDan Gohman2009-02-241-1/+1
| | | | | | | ashr instcombine to help expose this code. And apply the fix to SelectionDAG's copy of this code too. llvm-svn: 65364
* Introduce the BuildVectorSDNode class that encapsulates the ISD::BUILD_VECTORScott Michel2009-02-221-8/+145
| | | | | | | | | instruction. The class also consolidates the code for detecting constant splats that's shared across PowerPC and the CellSPU backends (and might be useful for other backends.) Also introduces SelectionDAG::getBUID_VECTOR() for generating new BUILD_VECTOR nodes. llvm-svn: 65296
* Remove trailing whitespace to reduce later commit patch noise.Scott Michel2009-02-171-169/+169
| | | | | | | | (Note: Eventually, commits like this will be handled via a pre-commit hook that does this automagically, as well as expand tabs to spaces and look for 80-col violations.) llvm-svn: 64827
* Use getDebugLoc forwarder instead of getNode()->getDebugLoc.Dale Johannesen2009-02-071-1/+1
| | | | | | No functional change. llvm-svn: 64026
* Make SDNode constructors take a DebugLoc always.Dale Johannesen2009-02-071-36/+4
| | | | | | | | | Adjust derived classes to pass UnknownLoc where a DebugLoc does not make sense. Pick one of DebugLoc and non-DebugLoc variants to survive for all such classes. llvm-svn: 64000
* Remove now-unused constructors.Dale Johannesen2009-02-071-21/+0
| | | | llvm-svn: 63995
* Get rid of the last non-DebugLoc versions of getNode!Dale Johannesen2009-02-071-14/+1
| | | | | | | | | | | | Many targets build placeholder nodes for special operands, e.g. GlobalBaseReg on X86 and PPC for the PIC base. There's no sensible way to associate debug info with these. I've left them built with getNode calls with explicit DebugLoc::getUnknownLoc operands. I'm not too happy about this but don't see a good improvement; I considered adding a getPseudoOperand or something, but it seems to me that'll just make it harder to read. llvm-svn: 63992
* Remove more non-DebugLoc getNode variants. UseDale Johannesen2009-02-061-27/+16
| | | | | | | | getCALLSEQ_{END,START} to permit passing no DebugLoc there. UNDEF doesn't logically have DebugLoc; add getUNDEF to encapsulate this. llvm-svn: 63978
* Remove more non-DebugLoc versions of getNode.Dale Johannesen2009-02-061-22/+0
| | | | llvm-svn: 63969
* Eliminate remaining non-DebugLoc version of getTargetNode.Dale Johannesen2009-02-061-39/+0
| | | | llvm-svn: 63951
* get rid of some non-DebugLoc getTargetNode variants.Dale Johannesen2009-02-061-41/+0
| | | | llvm-svn: 63909
* Get rid of one more non-DebugLoc getNode andDale Johannesen2009-02-061-11/+5
| | | | | | | its corresponding getTargetNode. Lots of caller changes. llvm-svn: 63904
* Remove a non-DebugLoc version of getNode.Dale Johannesen2009-02-051-6/+0
| | | | llvm-svn: 63889
* Remove 3 non-DebugLoc variants of getNode.Dale Johannesen2009-02-051-14/+0
| | | | llvm-svn: 63886
* Fix a bug where we were not emitting a cvt rnd sat node for convertingMon P Wang2009-02-051-2/+4
| | | | | | between a unsigned integer and signed integer. llvm-svn: 63831
* Get rid of 3 non-DebugLoc getNode variants.Dale Johannesen2009-02-051-17/+0
| | | | llvm-svn: 63808
* Remove non-DebugLoc versions of getMergeValues, ZeroExtendInReg.Dale Johannesen2009-02-051-20/+0
| | | | llvm-svn: 63800
* Remove non-DebugLoc forms of CopyToReg and CopyFromReg.Dale Johannesen2009-02-041-1/+1
| | | | | | Adjust callers. llvm-svn: 63789
* 80 column rule.Stuart Hastings2009-02-041-1/+2
| | | | llvm-svn: 63768
* Remove non-DebugLoc versions of getLoad and getStore.Dale Johannesen2009-02-041-85/+0
| | | | | | Adjust the many callers of those versions. llvm-svn: 63767
* Since I'm obliged to work with a development OS that currently doesn'tStuart Hastings2009-02-041-9/+56
| | | | | | | | | | support GraphViz, I've been using the foo->dump() facility. This patch is a minor rewrite to the SelectionDAG dump() stuff to make it a little more helpful. The existing foo->dump() functionality does not change; this patch adds foo->dumpr(). All of this is only useful when running LLVM under a debugger. llvm-svn: 63736
* Remove non-DebugLoc forms of the exotic formsDale Johannesen2009-02-041-82/+0
| | | | | | of Lod and Sto; patch uses. llvm-svn: 63716
* Remove some more non-DebugLoc versions of constructionDale Johannesen2009-02-041-40/+0
| | | | | | functions, with callers adjusted to fit. llvm-svn: 63705
* Remove a few non-DebugLoc versions of node creationDale Johannesen2009-02-041-138/+0
| | | | | | functions. llvm-svn: 63703
* DebugLoc propagation; adjustment to things omittedDale Johannesen2009-02-031-1/+22
| | | | | | from SelectionDagBuild. llvm-svn: 63680
* Add some DL propagation to places that didn'tDale Johannesen2009-02-031-36/+44
| | | | | | have it yet. More coming. llvm-svn: 63673
* First initialize DAG otherwise dwarf writer is used uninitialized.Devang Patel2009-02-031-1/+1
| | | | | | Duncan spotted this. Thanks! llvm-svn: 63641
* Fill in some missing DL propagation in getNode()s.Dale Johannesen2009-02-031-22/+24
| | | | llvm-svn: 63595
* Propagation in TargetLowering. Includes passing a DLDale Johannesen2009-02-031-11/+11
| | | | | | into SimplifySetCC which gets called elsewhere. llvm-svn: 63583
* Use the SubclassData field to hold ExtType, isTrunc, and MemIndexedModeDan Gohman2009-02-031-45/+40
| | | | | | | | information. This eliminates the need for the Flags field in MemSDNode, so this makes LoadSDNode and StoreSDNode smaller. Also, it makes FoldingSetNodeIDs for loads and stores two AddIntegers smaller. llvm-svn: 63577
* Commit missing files.Dale Johannesen2009-02-021-0/+14
| | | | llvm-svn: 63545
* Fix PR3453 and probably a bunch of other potentialDuncan Sands2009-02-011-3/+4
| | | | | | | | | crashes or wrong code with codegen of large integers: eliminate the legacy getIntegerVTBitMask and getIntegerVTSignBit methods, which returned their value as a uint64_t, so couldn't handle huge types. llvm-svn: 63494
* Fix PR3401: when using large integers, the typeDuncan Sands2009-01-311-3/+11
| | | | | | | | | | | | | returned by getShiftAmountTy may be too small to hold shift values (it is an i8 on x86-32). Before and during type legalization, use a large but legal type for shift amounts: getPointerTy; afterwards use getShiftAmountTy, fixing up any shift amounts with a big type during operation legalization. Thanks to Dan for writing the original patch (which I shamelessly pillaged). llvm-svn: 63482
* If unsafe FP optimization is not set, don't allow -(A-B) => B-A becauseMon P Wang2009-01-311-1/+2
| | | | | | when A==B, -0.0 != +0.0. llvm-svn: 63474
OpenPOWER on IntegriCloud